Update app.py
Browse files
app.py
CHANGED
|
@@ -6,8 +6,17 @@ from huggingface_hub import login
|
|
| 6 |
import os
|
| 7 |
import shutil
|
| 8 |
|
| 9 |
-
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
def analyze_data(csv_file, additional_notes=""):
|
| 13 |
# Clear previous figures
|
|
@@ -16,7 +25,7 @@ def analyze_data(csv_file, additional_notes=""):
|
|
| 16 |
os.makedirs('./figures', exist_ok=True)
|
| 17 |
|
| 18 |
# Initialize model and agent
|
| 19 |
-
model = HfApiModel("
|
| 20 |
agent = CodeAgent(
|
| 21 |
tools=[],
|
| 22 |
model=model,
|
|
|
|
| 6 |
import os
|
| 7 |
import shutil
|
| 8 |
|
| 9 |
+
from huggingface_hub import login
|
| 10 |
+
|
| 11 |
+
# Add this before model initialization
|
| 12 |
+
hf_token = os.getenv("HF_TOKEN")
|
| 13 |
+
login(token=hf_token, add_to_git_credential=True)
|
| 14 |
+
|
| 15 |
+
# Then create model with explicit token
|
| 16 |
+
model = HfApiModel(
|
| 17 |
+
"mistralai/Mixtral-8x7B-Instruct-v0.1",
|
| 18 |
+
token=hf_token # Pass token explicitly
|
| 19 |
+
)
|
| 20 |
|
| 21 |
def analyze_data(csv_file, additional_notes=""):
|
| 22 |
# Clear previous figures
|
|
|
|
| 25 |
os.makedirs('./figures', exist_ok=True)
|
| 26 |
|
| 27 |
# Initialize model and agent
|
| 28 |
+
model = HfApiModel("mistralai/Mixtral-8x7B-Instruct-v0.1") # Best overall
|
| 29 |
agent = CodeAgent(
|
| 30 |
tools=[],
|
| 31 |
model=model,
|