Spaces:
Runtime error
Runtime error
cspocketindia
commited on
Commit
·
f216bc1
1
Parent(s):
4e52c2b
Enable LFS
Browse files- gradio_app.py +6 -12
gradio_app.py
CHANGED
@@ -25,7 +25,7 @@ repo = huggingface_hub.Repository(
|
|
25 |
clone_from="https://huggingface.co/datasets/jeevavijay10/senti-pred-gradio",
|
26 |
token=hf_token,
|
27 |
)
|
28 |
-
repo.git_pull(lfs=
|
29 |
|
30 |
def log_record(vals):
|
31 |
|
@@ -45,20 +45,14 @@ def log_record(vals):
|
|
45 |
|
46 |
def predict(sentence):
|
47 |
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
start_time = time.time()
|
53 |
-
|
54 |
-
predictions = model.evaluate([sentence])
|
55 |
-
|
56 |
-
elapsed_time = time.time() - start_time
|
57 |
-
|
58 |
-
print(f"Predictions: {predictions}")
|
59 |
|
60 |
output = classes[predictions[0]]
|
61 |
|
|
|
62 |
log_record([sentence, output, timestamp, str(elapsed_time)])
|
63 |
|
64 |
return output
|
|
|
25 |
clone_from="https://huggingface.co/datasets/jeevavijay10/senti-pred-gradio",
|
26 |
token=hf_token,
|
27 |
)
|
28 |
+
repo.git_pull(lfs=True)
|
29 |
|
30 |
def log_record(vals):
|
31 |
|
|
|
45 |
|
46 |
def predict(sentence):
|
47 |
|
48 |
+
timestamp = datetime.datetime.now().isoformat()
|
49 |
+
start_time = time.time()
|
50 |
+
predictions = model.evaluate([sentence])
|
51 |
+
elapsed_time = time.time() - start_time
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
|
53 |
output = classes[predictions[0]]
|
54 |
|
55 |
+
print(f"Sentence: {sentence} \nPredictions: {predictions} - {output}")
|
56 |
log_record([sentence, output, timestamp, str(elapsed_time)])
|
57 |
|
58 |
return output
|