Spaces:
Runtime error
Runtime error
Update Agent.py
Browse files
Agent.py
CHANGED
|
@@ -5,9 +5,8 @@ from langchain.chat_models import ChatOpenAI
|
|
| 5 |
from langchain.memory import ConversationBufferMemory
|
| 6 |
from langchain_community.tools import DuckDuckGoSearchRun
|
| 7 |
from langchain.schema import SystemMessage
|
| 8 |
-
from langchain_community.chat_models import ChatHuggingFace
|
| 9 |
from langchain.schema.messages import HumanMessage
|
| 10 |
-
|
| 11 |
GAIA_SYSTEM_PROMPT = """
|
| 12 |
You are an advanced autonomous agent designed to pass the GAIA benchmark.
|
| 13 |
You must:
|
|
@@ -30,11 +29,12 @@ llm = ChatHuggingFace(
|
|
| 30 |
repo_id="HuggingFaceH4/zephyr-7b-beta",
|
| 31 |
model_kwargs={"temperature": 0.0, "max_new_tokens": 1024}
|
| 32 |
)
|
|
|
|
| 33 |
messages = [
|
| 34 |
SystemMessage(content=GAIA_SYSTEM_PROMPT)
|
| 35 |
]
|
| 36 |
|
| 37 |
-
response =
|
| 38 |
|
| 39 |
def calculator_tool(input: str) -> str:
|
| 40 |
try:
|
|
|
|
| 5 |
from langchain.memory import ConversationBufferMemory
|
| 6 |
from langchain_community.tools import DuckDuckGoSearchRun
|
| 7 |
from langchain.schema import SystemMessage
|
|
|
|
| 8 |
from langchain.schema.messages import HumanMessage
|
| 9 |
+
from langchain_huggingface import ChatHuggingFace
|
| 10 |
GAIA_SYSTEM_PROMPT = """
|
| 11 |
You are an advanced autonomous agent designed to pass the GAIA benchmark.
|
| 12 |
You must:
|
|
|
|
| 29 |
repo_id="HuggingFaceH4/zephyr-7b-beta",
|
| 30 |
model_kwargs={"temperature": 0.0, "max_new_tokens": 1024}
|
| 31 |
)
|
| 32 |
+
|
| 33 |
messages = [
|
| 34 |
SystemMessage(content=GAIA_SYSTEM_PROMPT)
|
| 35 |
]
|
| 36 |
|
| 37 |
+
response = llm.invoke(messages)
|
| 38 |
|
| 39 |
def calculator_tool(input: str) -> str:
|
| 40 |
try:
|