Trial and error.
Browse files
app.py
CHANGED
@@ -11,6 +11,8 @@ DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
|
|
11 |
|
12 |
# --- Basic Agent Definition ---
|
13 |
# ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
|
|
|
|
|
14 |
class BasicAgent:
|
15 |
def __init__(self):
|
16 |
print("BasicAgent initialized.")
|
@@ -20,7 +22,7 @@ class BasicAgent:
|
|
20 |
|
21 |
def __call__(self, question: str) -> str:
|
22 |
print(f"Agent received question (first 50 chars): {question[:50]}...")
|
23 |
-
|
24 |
try:
|
25 |
# Create messages for the model
|
26 |
messages = [
|
@@ -32,7 +34,7 @@ class BasicAgent:
|
|
32 |
print("Using Inference API for generation...")
|
33 |
response = self.client.text_generation(
|
34 |
prompt=question,
|
35 |
-
model="
|
36 |
max_new_tokens=500,
|
37 |
temperature=0.7,
|
38 |
do_sample=True,
|
@@ -174,7 +176,7 @@ def run_and_submit_all(profile: gr.OAuthProfile | None):
|
|
174 |
|
175 |
# --- Build Gradio Interface using Blocks ---
|
176 |
with gr.Blocks() as demo:
|
177 |
-
gr.Markdown("# Basic Agent Evaluation Runner #
|
178 |
gr.Markdown(
|
179 |
"""
|
180 |
**Instructions:**
|
|
|
11 |
|
12 |
# --- Basic Agent Definition ---
|
13 |
# ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
|
14 |
+
|
15 |
+
|
16 |
class BasicAgent:
|
17 |
def __init__(self):
|
18 |
print("BasicAgent initialized.")
|
|
|
22 |
|
23 |
def __call__(self, question: str) -> str:
|
24 |
print(f"Agent received question (first 50 chars): {question[:50]}...")
|
25 |
+
|
26 |
try:
|
27 |
# Create messages for the model
|
28 |
messages = [
|
|
|
34 |
print("Using Inference API for generation...")
|
35 |
response = self.client.text_generation(
|
36 |
prompt=question,
|
37 |
+
model="meta-llama/Llama-3-8B-Instruct", # Free model
|
38 |
max_new_tokens=500,
|
39 |
temperature=0.7,
|
40 |
do_sample=True,
|
|
|
176 |
|
177 |
# --- Build Gradio Interface using Blocks ---
|
178 |
with gr.Blocks() as demo:
|
179 |
+
gr.Markdown("# Basic Agent Evaluation Runner #9")
|
180 |
gr.Markdown(
|
181 |
"""
|
182 |
**Instructions:**
|