Spaces:
Runtime error
Runtime error
Commit
·
1cc716b
1
Parent(s):
03a6d30
files changed
Browse files
app.py
CHANGED
|
@@ -16,7 +16,7 @@ tokenizer = AutoTokenizer.from_pretrained("microsoft/phi-1_5", trust_remote_code
|
|
| 16 |
|
| 17 |
def infer(text):
|
| 18 |
inputs = tokenizer(f'''question: {text} answer: ''', return_tensors="pt", return_attention_mask=False)
|
| 19 |
-
outputs = model.generate(**inputs, max_length=
|
| 20 |
text = tokenizer.batch_decode(outputs)[0]
|
| 21 |
text = text.split('answer:',1)[1]
|
| 22 |
return text
|
|
|
|
| 16 |
|
| 17 |
def infer(text):
|
| 18 |
inputs = tokenizer(f'''question: {text} answer: ''', return_tensors="pt", return_attention_mask=False)
|
| 19 |
+
outputs = model.generate(**inputs, max_length=156)
|
| 20 |
text = tokenizer.batch_decode(outputs)[0]
|
| 21 |
text = text.split('answer:',1)[1]
|
| 22 |
return text
|