Spaces:
Running
on
Zero
Running
on
Zero
Lord-Raven
commited on
Commit
·
84cb97f
1
Parent(s):
b623ed0
Logging off.
Browse files
app.py
CHANGED
@@ -49,12 +49,12 @@ def classify(data_string, request: gradio.Request):
|
|
49 |
try:
|
50 |
if 'cpu' not in data:
|
51 |
result = zero_shot_classification_gpu(data)
|
52 |
-
print(f"{datetime.now().strftime('%Y-%m-%d %H:%M:%S')} - GPU Classification took {time.time() - start_time}
|
53 |
except Exception as e:
|
54 |
print(f"GPU classification failed: {e}\nFall back to CPU.")
|
55 |
if not result:
|
56 |
result = zero_shot_classification_cpu(data)
|
57 |
-
print(f"{datetime.now().strftime('%Y-%m-%d %H:%M:%S')} - CPU Classification took {time.time() - start_time}
|
58 |
return json.dumps(result)
|
59 |
|
60 |
def zero_shot_classification_cpu(data):
|
|
|
49 |
try:
|
50 |
if 'cpu' not in data:
|
51 |
result = zero_shot_classification_gpu(data)
|
52 |
+
print(f"{datetime.now().strftime('%Y-%m-%d %H:%M:%S')} - GPU Classification took {time.time() - start_time}")
|
53 |
except Exception as e:
|
54 |
print(f"GPU classification failed: {e}\nFall back to CPU.")
|
55 |
if not result:
|
56 |
result = zero_shot_classification_cpu(data)
|
57 |
+
print(f"{datetime.now().strftime('%Y-%m-%d %H:%M:%S')} - CPU Classification took {time.time() - start_time}")
|
58 |
return json.dumps(result)
|
59 |
|
60 |
def zero_shot_classification_cpu(data):
|