Spaces:
Sleeping
Sleeping
Update agent.py
Browse files
agent.py
CHANGED
@@ -126,9 +126,9 @@ with open("system_prompt.txt","r",encoding="utf-8") as f:
|
|
126 |
# 2) Build your graph
|
127 |
def build_graph(provider: str = "huggingface") -> Graph:
|
128 |
# 2a) Instantiate your LLM endpoint
|
129 |
-
api_token = os.getenv("
|
130 |
if not api_token:
|
131 |
-
raise ValueError("
|
132 |
llm = LLM(provider=provider, token=api_token, model="meta-llama/Llama-2-7b-chat-hf")
|
133 |
|
134 |
# 2b) Attach tools
|
|
|
126 |
# 2) Build your graph
|
127 |
def build_graph(provider: str = "huggingface") -> Graph:
|
128 |
# 2a) Instantiate your LLM endpoint
|
129 |
+
api_token = os.getenv("HF_TOKEN")
|
130 |
if not api_token:
|
131 |
+
raise ValueError("HF_TOKEN not found: please add it under Settings → Secrets and variables in your Space")
|
132 |
llm = LLM(provider=provider, token=api_token, model="meta-llama/Llama-2-7b-chat-hf")
|
133 |
|
134 |
# 2b) Attach tools
|