Facelook commited on
Commit
c0935d5
·
1 Parent(s): e2e0ad5

Trial and error.

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -17,16 +17,16 @@ class BasicAgent:
17
  def __init__(self):
18
  print("BasicAgent initialized.")
19
  # Try multiple models in order of preference with better error handling
20
- self.model_name = "Qwen/Qwen1.5-7B-Chat" # Default model
21
  self.hf_token = os.getenv("HF_TOKEN") # Get token from environment if available
22
 
23
- print(f"aaa, {os.getenv('HF_TOKEN')}")
24
-
25
  # List of fallback models (free models that don't require authentication)
26
  self.fallback_models = [
 
 
27
  "google/flan-t5-small", # Small but doesn't require authentication
28
  "facebook/opt-125m", # Another small fallback option
29
- "distilbert-base-uncased" # Even more basic fallback
30
  ]
31
 
32
  try:
@@ -270,6 +270,8 @@ def run_and_submit_all(profile: gr.OAuthProfile | None):
270
  agent_code = f"https://huggingface.co/spaces/{space_id}/tree/main"
271
  print(agent_code)
272
 
 
 
273
  # 2. Fetch Questions
274
  print(f"Fetching questions from: {questions_url}")
275
  try:
 
17
  def __init__(self):
18
  print("BasicAgent initialized.")
19
  # Try multiple models in order of preference with better error handling
20
+ self.model_name = "mistralai/Mistral-7B-v0.1" # Updated to Mistral 7B - free on HF Hub
21
  self.hf_token = os.getenv("HF_TOKEN") # Get token from environment if available
22
 
 
 
23
  # List of fallback models (free models that don't require authentication)
24
  self.fallback_models = [
25
+ "microsoft/phi-2", # 2.7B powerful model that's free to use
26
+ "TinyLlama/TinyLlama-1.1B-Chat-v1.0", # Smaller but efficient chat model
27
  "google/flan-t5-small", # Small but doesn't require authentication
28
  "facebook/opt-125m", # Another small fallback option
29
+ "bigscience/bloom-560m" # Small BLOOM model as final fallback
30
  ]
31
 
32
  try:
 
270
  agent_code = f"https://huggingface.co/spaces/{space_id}/tree/main"
271
  print(agent_code)
272
 
273
+ return
274
+
275
  # 2. Fetch Questions
276
  print(f"Fetching questions from: {questions_url}")
277
  try: