Kserus commited on
Commit
f70d050
·
verified ·
1 Parent(s): ae04a4a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -1
app.py CHANGED
@@ -26,6 +26,7 @@ class SmartAgent:
26
  model="google/flan-t5-base",
27
  max_new_tokens=128,
28
  temperature=0.3,
 
29
  device_map="auto"
30
  )
31
 
@@ -54,7 +55,8 @@ class SmartAgent:
54
  def __call__(self, question: str) -> str:
55
  # prompt = f"{self.system_prompt}\nQuestion: {question}\n"
56
  prompt = f"{self.system_prompt} Question: {question}"
57
- output = self.generator(prompt, return_full_text=False)[0]['generated_text']
 
58
  answer = self.extract_final_answer(output)
59
  print(f"[DEBUG] Question: {question}")
60
  print(f"[DEBUG] Output: {output}")
 
26
  model="google/flan-t5-base",
27
  max_new_tokens=128,
28
  temperature=0.3,
29
+ do_sample=True,
30
  device_map="auto"
31
  )
32
 
 
55
  def __call__(self, question: str) -> str:
56
  # prompt = f"{self.system_prompt}\nQuestion: {question}\n"
57
  prompt = f"{self.system_prompt} Question: {question}"
58
+ # output = self.generator(prompt, return_full_text=False)[0]['generated_text']
59
+ output = self.generator(prompt)[0]['generated_text']
60
  answer = self.extract_final_answer(output)
61
  print(f"[DEBUG] Question: {question}")
62
  print(f"[DEBUG] Output: {output}")