Aharneish commited on
Commit
f914252
·
verified ·
1 Parent(s): 1bac3fe

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -2,15 +2,17 @@ import os
2
  import gradio as gr
3
  import requests
4
  import pandas as pd
5
- from smolagents import CodeAgent, DuckDuckGoSearchTool, InferenceClientModel
 
6
 
7
  # --- Constants ---
8
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
 
9
 
10
  # --- Define Agent ---
11
  class SmolAgentWrapper:
12
  def __init__(self):
13
- self.model = InferenceClientModel(model_id="Qwen/Qwen2.5-Coder-32B-Instruct") # Uses flan-t5-base via HF Inference API
14
  self.tools = [DuckDuckGoSearchTool()] # You can add more tools here
15
  self.agent = CodeAgent(model=self.model, tools=self.tools)
16
 
 
2
  import gradio as gr
3
  import requests
4
  import pandas as pd
5
+ from smolagents import CodeAgent, DuckDuckGoSearchTool
6
+ from transformers import pipeline
7
 
8
  # --- Constants ---
9
  DEFAULT_API_URL = "https://agents-course-unit4-scoring.hf.space"
10
+ pipe = pipeline("text-generation", model="openai-community/gpt2")
11
 
12
  # --- Define Agent ---
13
  class SmolAgentWrapper:
14
  def __init__(self):
15
+ self.model = pipe # Uses flan-t5-base via HF Inference API
16
  self.tools = [DuckDuckGoSearchTool()] # You can add more tools here
17
  self.agent = CodeAgent(model=self.model, tools=self.tools)
18