Spaces:
Sleeping
Sleeping
add token
Browse files
app.py
CHANGED
@@ -1,6 +1,9 @@
|
|
|
|
1 |
import networkx as nx
|
2 |
from smolagents import CodeAgent, HfApiModel, tool, GradioUI
|
3 |
|
|
|
|
|
4 |
# Define a tool for analyzing the Florentine Families graph
|
5 |
@tool
|
6 |
def analyze_florentine_graph(metric: str) -> str:
|
@@ -30,7 +33,7 @@ def analyze_florentine_graph(metric: str) -> str:
|
|
30 |
return analysis
|
31 |
|
32 |
# Initialize the agent with proper configuration
|
33 |
-
model = HfApiModel("meta-llama/Llama-3.3-70B-Instruct")
|
34 |
agent = CodeAgent(
|
35 |
tools=[analyze_florentine_graph],
|
36 |
model=model,
|
|
|
1 |
+
import os
|
2 |
import networkx as nx
|
3 |
from smolagents import CodeAgent, HfApiModel, tool, GradioUI
|
4 |
|
5 |
+
HF_TOKEN = os.getenv("HF_TOKEN")
|
6 |
+
|
7 |
# Define a tool for analyzing the Florentine Families graph
|
8 |
@tool
|
9 |
def analyze_florentine_graph(metric: str) -> str:
|
|
|
33 |
return analysis
|
34 |
|
35 |
# Initialize the agent with proper configuration
|
36 |
+
model = HfApiModel(model="meta-llama/Llama-3.3-70B-Instruct", token=HF_TOKEN)
|
37 |
agent = CodeAgent(
|
38 |
tools=[analyze_florentine_graph],
|
39 |
model=model,
|