Update app.py
Browse files
app.py
CHANGED
@@ -4,7 +4,7 @@ import tempfile
|
|
4 |
import gradio as gr
|
5 |
from smolagents import CodeAgent, InferenceClientModel
|
6 |
from smolagents import HfApiModel
|
7 |
-
from transformers import load_tool
|
8 |
|
9 |
#%% Methods
|
10 |
# Function to add a label to an image
|
@@ -104,8 +104,8 @@ def generate_object_history(object_name):
|
|
104 |
|
105 |
#%% Initialization of tools and AI_Agent
|
106 |
# Import text-to-image tool from Hub
|
107 |
-
from smolagents.tools import Tool
|
108 |
-
image_generation_tool = load_tool("m-ric/text-to-image", cache=False)
|
109 |
|
110 |
class WrappedTextToImageTool(Tool):
|
111 |
def run(self, *args, **kwargs):
|
|
|
4 |
import gradio as gr
|
5 |
from smolagents import CodeAgent, InferenceClientModel
|
6 |
from smolagents import HfApiModel
|
7 |
+
#from transformers import load_tool
|
8 |
|
9 |
#%% Methods
|
10 |
# Function to add a label to an image
|
|
|
104 |
|
105 |
#%% Initialization of tools and AI_Agent
|
106 |
# Import text-to-image tool from Hub
|
107 |
+
from smolagents.tools import Tool, load_tool
|
108 |
+
image_generation_tool = load_tool("m-ric/text-to-image", cache=False, trust_remote_code=True)
|
109 |
|
110 |
class WrappedTextToImageTool(Tool):
|
111 |
def run(self, *args, **kwargs):
|