Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,12 +1,12 @@
|
|
| 1 |
import os
|
| 2 |
-
os.environ["TRANSFORMERS_NO_TF"] = "1"
|
| 3 |
|
| 4 |
import gradio as gr
|
| 5 |
import requests
|
| 6 |
import inspect
|
| 7 |
import pandas as pd
|
| 8 |
import time
|
| 9 |
-
from transformers import pipeline
|
| 10 |
from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel
|
| 11 |
# (Keep Constants as is)
|
| 12 |
# --- Constants ---
|
|
@@ -19,7 +19,7 @@ class BasicAgent:
|
|
| 19 |
def __init__(self):
|
| 20 |
print("BasicAgent initialized.")
|
| 21 |
# Initialize a small local model instead of API model
|
| 22 |
-
self.model =
|
| 23 |
|
| 24 |
# Initialize the search tool (you can keep DuckDuckGoSearchTool)
|
| 25 |
search_tool = DuckDuckGoSearchTool()
|
|
|
|
| 1 |
import os
|
| 2 |
+
#os.environ["TRANSFORMERS_NO_TF"] = "1"
|
| 3 |
|
| 4 |
import gradio as gr
|
| 5 |
import requests
|
| 6 |
import inspect
|
| 7 |
import pandas as pd
|
| 8 |
import time
|
| 9 |
+
#from transformers import pipeline
|
| 10 |
from smolagents import CodeAgent, DuckDuckGoSearchTool, HfApiModel
|
| 11 |
# (Keep Constants as is)
|
| 12 |
# --- Constants ---
|
|
|
|
| 19 |
def __init__(self):
|
| 20 |
print("BasicAgent initialized.")
|
| 21 |
# Initialize a small local model instead of API model
|
| 22 |
+
self.model = HfApiModel("text-generation", model="mistralai/Mistral-7B-v0.1")
|
| 23 |
|
| 24 |
# Initialize the search tool (you can keep DuckDuckGoSearchTool)
|
| 25 |
search_tool = DuckDuckGoSearchTool()
|