Spaces:
Runtime error
Runtime error
Update tools.py
Browse files
tools.py
CHANGED
@@ -96,7 +96,7 @@ class evaluate_consumption_example(Tool):
|
|
96 |
i=0
|
97 |
for data in iter(test_dataset):
|
98 |
print(i)
|
99 |
-
if (i<=
|
100 |
with torch.no_grad():
|
101 |
result = classifier(np.asarray(data["input_values"]), batch_size=64)
|
102 |
predicted_label = result[0]['label']
|
@@ -109,7 +109,7 @@ class evaluate_consumption_example(Tool):
|
|
109 |
torch.cuda.empty_cache()
|
110 |
gc.collect()
|
111 |
i=i+1
|
112 |
-
if(i>
|
113 |
break
|
114 |
logging.info("Fin des prédictions")
|
115 |
del classifier
|
|
|
96 |
i=0
|
97 |
for data in iter(test_dataset):
|
98 |
print(i)
|
99 |
+
if (i<=5):
|
100 |
with torch.no_grad():
|
101 |
result = classifier(np.asarray(data["input_values"]), batch_size=64)
|
102 |
predicted_label = result[0]['label']
|
|
|
109 |
torch.cuda.empty_cache()
|
110 |
gc.collect()
|
111 |
i=i+1
|
112 |
+
if(i>5):
|
113 |
break
|
114 |
logging.info("Fin des prédictions")
|
115 |
del classifier
|