Spaces:
Sleeping
Sleeping
vickeee465
commited on
Commit
·
1586d22
1
Parent(s):
d94d4e0
tqdm for debugging
Browse files
app.py
CHANGED
|
@@ -12,6 +12,7 @@ from matplotlib.colors import LinearSegmentedColormap
|
|
| 12 |
import matplotlib.colors as mcolors
|
| 13 |
import plotly.express as px
|
| 14 |
import seaborn as sns
|
|
|
|
| 15 |
|
| 16 |
PATH = '/data/' # at least 150GB storage needs to be attached
|
| 17 |
os.environ['TRANSFORMERS_CACHE'] = PATH
|
|
@@ -189,7 +190,7 @@ def predict_wrapper(text, language):
|
|
| 189 |
|
| 190 |
results = []
|
| 191 |
results_heatmap = []
|
| 192 |
-
for sentence in sentences:
|
| 193 |
probs = predict(sentence, model_id, tokenizer_id)
|
| 194 |
label, probability = get_most_probable_label(probs)
|
| 195 |
results.append([sentence, label, probability])
|
|
@@ -228,7 +229,7 @@ with gr.Blocks() as demo:
|
|
| 228 |
piechart = gr.Plot()
|
| 229 |
with gr.Column(scale=3):
|
| 230 |
gr.Markdown(placeholder)
|
| 231 |
-
|
| 232 |
with gr.Row():
|
| 233 |
with gr.Column(scale=7):
|
| 234 |
plot = gr.Plot()
|
|
|
|
| 12 |
import matplotlib.colors as mcolors
|
| 13 |
import plotly.express as px
|
| 14 |
import seaborn as sns
|
| 15 |
+
from tqdm import tqdm
|
| 16 |
|
| 17 |
PATH = '/data/' # at least 150GB storage needs to be attached
|
| 18 |
os.environ['TRANSFORMERS_CACHE'] = PATH
|
|
|
|
| 190 |
|
| 191 |
results = []
|
| 192 |
results_heatmap = []
|
| 193 |
+
for sentence in tqdm(sentences):
|
| 194 |
probs = predict(sentence, model_id, tokenizer_id)
|
| 195 |
label, probability = get_most_probable_label(probs)
|
| 196 |
results.append([sentence, label, probability])
|
|
|
|
| 229 |
piechart = gr.Plot()
|
| 230 |
with gr.Column(scale=3):
|
| 231 |
gr.Markdown(placeholder)
|
| 232 |
+
|
| 233 |
with gr.Row():
|
| 234 |
with gr.Column(scale=7):
|
| 235 |
plot = gr.Plot()
|