Spaces:
Sleeping
Sleeping
Update core_agent.py
Browse files- core_agent.py +4 -4
core_agent.py
CHANGED
|
@@ -16,13 +16,13 @@ import json
|
|
| 16 |
import requests
|
| 17 |
from urllib.parse import urlparse
|
| 18 |
# Load model directly
|
| 19 |
-
from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 20 |
from huggingface_hub import login
|
| 21 |
|
| 22 |
login(token=os.environ.get("HUGGINGFACEHUB_API_TOKEN"))
|
| 23 |
|
| 24 |
-
tokenizer = AutoTokenizer.from_pretrained("mistralai/Mistral-7B-Instruct-v0.2")
|
| 25 |
-
modelMistral = AutoModelForCausalLM.from_pretrained("mistralai/Mistral-7B-Instruct-v0.2")
|
| 26 |
|
| 27 |
@tool
|
| 28 |
def save_and_read_file(content: str, filename: Optional[str] = None) -> str:
|
|
@@ -345,7 +345,7 @@ class GAIAAgent:
|
|
| 345 |
|
| 346 |
self.agent = CodeAgent(
|
| 347 |
tools=self.tools,
|
| 348 |
-
model=
|
| 349 |
additional_authorized_imports=self.imports,
|
| 350 |
executor_type=executor_type,
|
| 351 |
executor_kwargs=executor_kwargs,
|
|
|
|
| 16 |
import requests
|
| 17 |
from urllib.parse import urlparse
|
| 18 |
# Load model directly
|
| 19 |
+
# from transformers import AutoTokenizer, AutoModelForCausalLM
|
| 20 |
from huggingface_hub import login
|
| 21 |
|
| 22 |
login(token=os.environ.get("HUGGINGFACEHUB_API_TOKEN"))
|
| 23 |
|
| 24 |
+
# tokenizer = AutoTokenizer.from_pretrained("mistralai/Mistral-7B-Instruct-v0.2")
|
| 25 |
+
# modelMistral = AutoModelForCausalLM.from_pretrained("mistralai/Mistral-7B-Instruct-v0.2")
|
| 26 |
|
| 27 |
@tool
|
| 28 |
def save_and_read_file(content: str, filename: Optional[str] = None) -> str:
|
|
|
|
| 345 |
|
| 346 |
self.agent = CodeAgent(
|
| 347 |
tools=self.tools,
|
| 348 |
+
model=self.model,
|
| 349 |
additional_authorized_imports=self.imports,
|
| 350 |
executor_type=executor_type,
|
| 351 |
executor_kwargs=executor_kwargs,
|