Spaces:
Running
on
Zero
Running
on
Zero
Lord-Raven
commited on
Commit
·
aef28a9
1
Parent(s):
f63295c
Messing with fastAPI.
Browse files
app.py
CHANGED
@@ -52,9 +52,9 @@ def classify(data_string, request: gradio.Request):
|
|
52 |
# else:
|
53 |
start_time = time.time()
|
54 |
result = {}
|
55 |
-
if (data['cpu'])
|
56 |
result = zero_shot_classification_cpu(data)
|
57 |
-
else
|
58 |
result = zero_shot_classification_gpu(data)
|
59 |
print(f"Classification @ [{datetime.now().strftime('%Y-%m-%d %H:%M:%S')}] took {time.time() - start_time}.")
|
60 |
return json.dumps(result)
|
|
|
52 |
# else:
|
53 |
start_time = time.time()
|
54 |
result = {}
|
55 |
+
if (data['cpu']):
|
56 |
result = zero_shot_classification_cpu(data)
|
57 |
+
else:
|
58 |
result = zero_shot_classification_gpu(data)
|
59 |
print(f"Classification @ [{datetime.now().strftime('%Y-%m-%d %H:%M:%S')}] took {time.time() - start_time}.")
|
60 |
return json.dumps(result)
|