Update app.py
Browse files
app.py
CHANGED
@@ -191,13 +191,13 @@ def generate_response(transcription):
|
|
191 |
with torch.no_grad():
|
192 |
output = model.generate(
|
193 |
input_ids,
|
194 |
-
max_new_tokens=
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
)
|
202 |
generated_text = tokenizer.decode(output[0], skip_special_tokens=True)
|
203 |
return find_last_sentence(generated_text)
|
|
|
191 |
with torch.no_grad():
|
192 |
output = model.generate(
|
193 |
input_ids,
|
194 |
+
max_new_tokens=300,
|
195 |
+
do_sample=True,
|
196 |
+
top_k=5,
|
197 |
+
num_beams=1,
|
198 |
+
use_cache=False,
|
199 |
+
temperature=0.2,
|
200 |
+
repetition_penalty=1.1,
|
201 |
)
|
202 |
generated_text = tokenizer.decode(output[0], skip_special_tokens=True)
|
203 |
return find_last_sentence(generated_text)
|