Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,9 +1,10 @@
|
|
| 1 |
-
from transformers import load_tool, ReactCodeAgent, HfApiEngine
|
| 2 |
from PIL import Image, ImageDraw, ImageFont
|
| 3 |
import tempfile
|
| 4 |
import gradio as gr
|
| 5 |
-
|
| 6 |
-
|
|
|
|
| 7 |
|
| 8 |
#%% Methods
|
| 9 |
# Function to add a label to an image
|
|
@@ -113,7 +114,8 @@ search_tool = DuckDuckGoSearchTool()
|
|
| 113 |
llm_engine = HfApiEngine("Qwen/Qwen2.5-72B-Instruct")
|
| 114 |
|
| 115 |
# Initialize the agent with both tools
|
| 116 |
-
agent = ReactCodeAgent(tools=[image_generation_tool, search_tool], llm_engine=llm_engine)
|
|
|
|
| 117 |
|
| 118 |
# Gradio interface
|
| 119 |
def create_gradio_interface():
|
|
|
|
| 1 |
+
#from transformers import load_tool, ReactCodeAgent, HfApiEngine
|
| 2 |
from PIL import Image, ImageDraw, ImageFont
|
| 3 |
import tempfile
|
| 4 |
import gradio as gr
|
| 5 |
+
from smolagents import CodeAgent, InferenceClientModel
|
| 6 |
+
from smolagents import HfApiEngine
|
| 7 |
+
from transformers import load_tool
|
| 8 |
|
| 9 |
#%% Methods
|
| 10 |
# Function to add a label to an image
|
|
|
|
| 114 |
llm_engine = HfApiEngine("Qwen/Qwen2.5-72B-Instruct")
|
| 115 |
|
| 116 |
# Initialize the agent with both tools
|
| 117 |
+
#agent = ReactCodeAgent(tools=[image_generation_tool, search_tool], llm_engine=llm_engine)
|
| 118 |
+
agent = CodeAgent(tools=[image_generation_tool, search_tool], llm_engine=llm_engine)
|
| 119 |
|
| 120 |
# Gradio interface
|
| 121 |
def create_gradio_interface():
|