Facelook commited on
Commit
573e5d2
·
1 Parent(s): ea0cae2

Trial and error.

Browse files
Files changed (1) hide show
  1. app.py +11 -4
app.py CHANGED
@@ -30,9 +30,16 @@ class BasicAgent:
30
 
31
  # Generate response
32
  print("Using Inference API for generation...")
33
- response = self.client.text_generation(messages)
34
- print(f"Inference API response received. {len(response.choices)} choices.")
35
- answer = response.choices[0].message.content
 
 
 
 
 
 
 
36
  print(f"Agent generated response (first 50 chars): {answer[:50]}...")
37
  return answer
38
  except Exception as e:
@@ -167,7 +174,7 @@ def run_and_submit_all(profile: gr.OAuthProfile | None):
167
 
168
  # --- Build Gradio Interface using Blocks ---
169
  with gr.Blocks() as demo:
170
- gr.Markdown("# Basic Agent Evaluation Runner #7")
171
  gr.Markdown(
172
  """
173
  **Instructions:**
 
30
 
31
  # Generate response
32
  print("Using Inference API for generation...")
33
+ response = self.client.text_generation(
34
+ prompt=question,
35
+ model="mistralai/Mistral-7B-Instruct-v0.2", # Free model available on Hugging Face
36
+ max_new_tokens=500,
37
+ temperature=0.7,
38
+ do_sample=True,
39
+ repetition_penalty=1.2
40
+ )
41
+ print(f"Inference API response received.")
42
+ answer = response
43
  print(f"Agent generated response (first 50 chars): {answer[:50]}...")
44
  return answer
45
  except Exception as e:
 
174
 
175
  # --- Build Gradio Interface using Blocks ---
176
  with gr.Blocks() as demo:
177
+ gr.Markdown("# Basic Agent Evaluation Runner #8")
178
  gr.Markdown(
179
  """
180
  **Instructions:**