Spaces:
Sleeping
Sleeping
EtienneB
commited on
Commit
·
1c5b21d
1
Parent(s):
43da00a
updates
Browse files
agent.py
CHANGED
@@ -1,3 +1,4 @@
|
|
|
|
1 |
from typing import Annotated, TypedDict
|
2 |
|
3 |
from langchain_community.chat_models import ChatHuggingFace
|
@@ -64,4 +65,6 @@ builder.add_conditional_edges(
|
|
64 |
tools_condition,
|
65 |
)
|
66 |
builder.add_edge("tools", "assistant")
|
67 |
-
alfred = builder.compile()
|
|
|
|
|
|
1 |
+
"""
|
2 |
from typing import Annotated, TypedDict
|
3 |
|
4 |
from langchain_community.chat_models import ChatHuggingFace
|
|
|
65 |
tools_condition,
|
66 |
)
|
67 |
builder.add_edge("tools", "assistant")
|
68 |
+
alfred = builder.compile()
|
69 |
+
|
70 |
+
"""
|
app.py
CHANGED
@@ -28,6 +28,9 @@ HUGGINGFACEHUB_API_TOKEN = os.getenv("HUGGINGFACEHUB_API_TOKEN")
|
|
28 |
# ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
|
29 |
class BasicAgent:
|
30 |
def __init__(self):
|
|
|
|
|
|
|
31 |
print("BasicAgent initialized.")
|
32 |
self.llm = HuggingFaceEndpoint(
|
33 |
repo_id="Qwen/Qwen2.5-Coder-32B-Instruct",
|
|
|
28 |
# ----- THIS IS WERE YOU CAN BUILD WHAT YOU WANT ------
|
29 |
class BasicAgent:
|
30 |
def __init__(self):
|
31 |
+
if not HUGGINGFACEHUB_API_TOKEN:
|
32 |
+
raise ValueError("Missing Hugging Face API token. Please set HUGGINGFACEHUB_API_TOKEN.")
|
33 |
+
|
34 |
print("BasicAgent initialized.")
|
35 |
self.llm = HuggingFaceEndpoint(
|
36 |
repo_id="Qwen/Qwen2.5-Coder-32B-Instruct",
|