Spaces:
Runtime error
Runtime error
Ubuntu
commited on
Commit
•
2eea2fb
1
Parent(s):
df4c9ba
Add time
Browse files
app.py
CHANGED
@@ -21,7 +21,7 @@ def process(text, top_k=5):
|
|
21 |
pred = p(text, top_k=top_k)
|
22 |
tock = time.time()
|
23 |
scores = {x["label"]: x["score"] for x in pred}
|
24 |
-
msg = f'Predicted in {(tock-tick)
|
25 |
return scores, msg
|
26 |
|
27 |
|
|
|
21 |
pred = p(text, top_k=top_k)
|
22 |
tock = time.time()
|
23 |
scores = {x["label"]: x["score"] for x in pred}
|
24 |
+
msg = f'Predicted in {(tock-tick)*1000:.2f} milliseconds'
|
25 |
return scores, msg
|
26 |
|
27 |
|