Spaces:
Sleeping
Sleeping
minor fix 2
Browse files
qwen_classifier/evaluate.py
CHANGED
@@ -15,13 +15,12 @@ from pathlib import Path
|
|
15 |
from .config import TAG_NAMES, DEVICE, SPACE_URL, EVAL_LIMIT
|
16 |
from .globals import global_model, global_tokenizer
|
17 |
|
18 |
-
|
19 |
-
if not eval_limit:
|
20 |
-
eval_limit = EVAL_LIMIT
|
21 |
-
else:
|
22 |
-
eval_limit = int(eval_limit)
|
23 |
|
24 |
def _load_data(test_data_path):
|
|
|
|
|
|
|
25 |
test_data_path = Path(__file__).parent / test_data_path
|
26 |
# Check file existence
|
27 |
if not os.path.exists(test_data_path):
|
@@ -45,7 +44,7 @@ def _load_data(test_data_path):
|
|
45 |
raise ValueError("Empty zip archive - no files found")
|
46 |
|
47 |
# Process files with limit
|
48 |
-
for name in names[1:1+eval_limit]:
|
49 |
try:
|
50 |
with zip_file.open(name) as f:
|
51 |
content = f.read()
|
|
|
15 |
from .config import TAG_NAMES, DEVICE, SPACE_URL, EVAL_LIMIT
|
16 |
from .globals import global_model, global_tokenizer
|
17 |
|
18 |
+
|
|
|
|
|
|
|
|
|
19 |
|
20 |
def _load_data(test_data_path):
|
21 |
+
eval_limit = os.getenv("EVAL_LIM")
|
22 |
+
if not eval_limit:
|
23 |
+
eval_limit = EVAL_LIMIT
|
24 |
test_data_path = Path(__file__).parent / test_data_path
|
25 |
# Check file existence
|
26 |
if not os.path.exists(test_data_path):
|
|
|
44 |
raise ValueError("Empty zip archive - no files found")
|
45 |
|
46 |
# Process files with limit
|
47 |
+
for name in names[1:1+int(eval_limit)]:
|
48 |
try:
|
49 |
with zip_file.open(name) as f:
|
50 |
content = f.read()
|