Spaces:
Runtime error
Runtime error
pratik-aivantage
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -31,7 +31,7 @@ tokenizer = AutoTokenizer.from_pretrained(model_name, trust_remote_code=True)
|
|
31 |
|
32 |
def generate_answer(question):
|
33 |
inputs = tokenizer.encode("Question: " + question, return_tensors="pt")
|
34 |
-
outputs = model.generate(inputs, max_length=
|
35 |
answer = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
36 |
return answer
|
37 |
|
|
|
31 |
|
32 |
def generate_answer(question):
|
33 |
inputs = tokenizer.encode("Question: " + question, return_tensors="pt")
|
34 |
+
outputs = model.generate(inputs, max_length=2000, num_return_sequences=1, do_sample=True)
|
35 |
answer = tokenizer.decode(outputs[0], skip_special_tokens=True)
|
36 |
return answer
|
37 |
|