Manoj Kumar
commited on
Commit
·
31e0915
1
Parent(s):
a634168
updated question structure
Browse files- database.py +1 -1
database.py
CHANGED
@@ -55,7 +55,7 @@ def answer_question(context, question):
|
|
55 |
"""
|
56 |
prompt = f"{context}\n\nUser Question: {question}\nSQL Query or Answer:"
|
57 |
inputs = tokenizer(prompt, return_tensors="pt", truncation=True)
|
58 |
-
outputs = model.generate(inputs.input_ids, max_length=
|
59 |
return tokenizer.decode(outputs[0], skip_special_tokens=True)
|
60 |
|
61 |
# Interactive loop
|
|
|
55 |
"""
|
56 |
prompt = f"{context}\n\nUser Question: {question}\nSQL Query or Answer:"
|
57 |
inputs = tokenizer(prompt, return_tensors="pt", truncation=True)
|
58 |
+
outputs = model.generate(inputs.input_ids, max_length=512, num_beams=5, early_stopping=True)
|
59 |
return tokenizer.decode(outputs[0], skip_special_tokens=True)
|
60 |
|
61 |
# Interactive loop
|