Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -127,7 +127,7 @@ def document_qna_tool(pdf_path: str, question: str) -> str:
|
|
| 127 |
qa_pipeline = pipeline("text2text-generation", model="google/flan-t5-base")
|
| 128 |
prompt = f"Context: {best_context}\nQuestion: {question}"
|
| 129 |
print("[DEBUG] Calling QA model...")
|
| 130 |
-
answer = qa_pipeline(prompt, max_new_tokens=
|
| 131 |
|
| 132 |
return f"Answer: {answer.strip()}"
|
| 133 |
|
|
|
|
| 127 |
qa_pipeline = pipeline("text2text-generation", model="google/flan-t5-base")
|
| 128 |
prompt = f"Context: {best_context}\nQuestion: {question}"
|
| 129 |
print("[DEBUG] Calling QA model...")
|
| 130 |
+
answer = qa_pipeline(prompt, max_new_tokens=500)[0]['generated_text']
|
| 131 |
|
| 132 |
return f"Answer: {answer.strip()}"
|
| 133 |
|