SamarthPujari commited on
Commit
f418715
·
verified ·
1 Parent(s): 6bc52df

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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=100)[0]['generated_text']
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