Update app.py
Browse files
app.py
CHANGED
@@ -88,9 +88,10 @@ def generate_response(prompt: str) -> str:
|
|
88 |
|
89 |
prompt_template = f'{PERSONA_DESC}\n\nASSISTANT: {prompt}\n'
|
90 |
|
91 |
-
input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.
|
92 |
-
output = model.generate(input_ids, temperature=0.7, do_sample=True, top_p=0.95, top_k=40,
|
93 |
-
generated_text = tokenizer.decode(output[0]
|
|
|
94 |
|
95 |
return generated_text
|
96 |
|
|
|
88 |
|
89 |
prompt_template = f'{PERSONA_DESC}\n\nASSISTANT: {prompt}\n'
|
90 |
|
91 |
+
input_ids = tokenizer(prompt_template, return_tensors='pt').input_ids.cuda()
|
92 |
+
output = model.generate(inputs=input_ids, temperature=0.7, do_sample=True, top_p=0.95, top_k=40, max_new_tokens=512)
|
93 |
+
generated_text = tokenizer.decode(output[0])
|
94 |
+
|
95 |
|
96 |
return generated_text
|
97 |
|