Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -38,12 +38,13 @@ Answer:"""
|
|
| 38 |
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
|
| 39 |
|
| 40 |
output = model.generate(
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
|
|
|
| 47 |
)
|
| 48 |
|
| 49 |
decoded_output = tokenizer.decode(output[0], skip_special_tokens=True)
|
|
|
|
| 38 |
inputs = tokenizer(prompt, return_tensors="pt").to(model.device)
|
| 39 |
|
| 40 |
output = model.generate(
|
| 41 |
+
**inputs,
|
| 42 |
+
max_new_tokens=512, # allow longer answers
|
| 43 |
+
do_sample=True,
|
| 44 |
+
top_p=0.9,
|
| 45 |
+
temperature=0.7,
|
| 46 |
+
repetition_penalty=1.1
|
| 47 |
+
|
| 48 |
)
|
| 49 |
|
| 50 |
decoded_output = tokenizer.decode(output[0], skip_special_tokens=True)
|