deanoreese commited on
Commit
aba01bb
·
verified ·
1 Parent(s): 4b7a73e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -15,17 +15,17 @@ import os
15
 
16
  class BasicAgent:
17
  def __init__(self):
18
- print("✅ Initializing basic HF pipeline...")
19
  self.generator = pipeline(
20
  "text-generation",
21
- model="mistralai/Mistral-7B-Instruct-v0.2",
22
  token=os.getenv("HF_API_KEY")
23
  )
24
 
25
  def __call__(self, question: str) -> str:
26
- result = self.generator(f"Answer this question accurately: {question}", max_length=256, do_sample=False)
27
- return result[0]['generated_text'].split("Answer this question accurately:")[-1].strip()
28
-
29
 
30
 
31
  def run_and_submit_all( profile: gr.OAuthProfile | None):
 
15
 
16
  class BasicAgent:
17
  def __init__(self):
18
+ print("✅ Initializing open-access model...")
19
  self.generator = pipeline(
20
  "text-generation",
21
+ model="tiiuae/falcon-7b-instruct", # ✅ PUBLICALLY AVAILABLE MODEL
22
  token=os.getenv("HF_API_KEY")
23
  )
24
 
25
  def __call__(self, question: str) -> str:
26
+ prompt = f"Answer this question accurately: {question}"
27
+ result = self.generator(prompt, max_length=256, do_sample=False)
28
+ return result[0]['generated_text'].replace(prompt, '').strip()
29
 
30
 
31
  def run_and_submit_all( profile: gr.OAuthProfile | None):