Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
|
@@ -15,6 +15,7 @@ import torch
|
|
| 15 |
import random
|
| 16 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
| 17 |
from collections import defaultdict
|
|
|
|
| 18 |
|
| 19 |
# Global model and tokenizer
|
| 20 |
model = None
|
|
@@ -200,17 +201,10 @@ def load_dataset():
|
|
| 200 |
"""Load dataset and group examples by label"""
|
| 201 |
global dataset_by_label, dataset_path
|
| 202 |
|
| 203 |
-
|
| 204 |
-
"xlam_function_calling_60k_processed_with_ground_truth.json",
|
| 205 |
-
os.getenv("DATASET_PATH", "")
|
| 206 |
-
]
|
| 207 |
|
| 208 |
|
| 209 |
-
dataset_path =
|
| 210 |
-
for path in possible_paths:
|
| 211 |
-
if path and os.path.exists(path):
|
| 212 |
-
dataset_path = path
|
| 213 |
-
break
|
| 214 |
|
| 215 |
if not dataset_path:
|
| 216 |
print("Warning: Dataset file not found. Using hardcoded examples.")
|
|
|
|
| 15 |
import random
|
| 16 |
from transformers import AutoTokenizer, AutoModelForSequenceClassification
|
| 17 |
from collections import defaultdict
|
| 18 |
+
import Path
|
| 19 |
|
| 20 |
# Global model and tokenizer
|
| 21 |
model = None
|
|
|
|
| 201 |
"""Load dataset and group examples by label"""
|
| 202 |
global dataset_by_label, dataset_path
|
| 203 |
|
| 204 |
+
|
|
|
|
|
|
|
|
|
|
| 205 |
|
| 206 |
|
| 207 |
+
dataset_path = Path("xlam_function_calling_60k_processed_with_ground_truth.json")
|
|
|
|
|
|
|
|
|
|
|
|
|
| 208 |
|
| 209 |
if not dataset_path:
|
| 210 |
print("Warning: Dataset file not found. Using hardcoded examples.")
|