Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -41,12 +41,14 @@ def ask():
|
|
| 41 |
|
| 42 |
inputs = tokenizer(prompt, return_tensors="pt").to(DEVICE)
|
| 43 |
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
|
|
|
|
|
|
| 50 |
|
| 51 |
text = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 52 |
reply = text.split("Assistant:")[-1].strip()
|
|
|
|
| 41 |
|
| 42 |
inputs = tokenizer(prompt, return_tensors="pt").to(DEVICE)
|
| 43 |
|
| 44 |
+
outputs = model.generate(
|
| 45 |
+
**inputs,
|
| 46 |
+
max_new_tokens=80,
|
| 47 |
+
do_sample=False,
|
| 48 |
+
temperature=0.0,
|
| 49 |
+
eos_token_id=tokenizer.eos_token_id
|
| 50 |
+
)
|
| 51 |
+
|
| 52 |
|
| 53 |
text = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
| 54 |
reply = text.split("Assistant:")[-1].strip()
|