Davide Fiocco commited on
Commit
ec73fe0
·
1 Parent(s): f84eaa9

Remove try block for debugging

Browse files
Files changed (1) hide show
  1. app.py +10 -14
app.py CHANGED
@@ -14,24 +14,20 @@ labels = st.text_input("Enter comma-separated labels:")
14
 
15
  if st.button("Calculate labels"):
16
 
17
- try:
18
- labels_list = labels.split(",")
19
- table = pd.read_excel(data)
20
- table = table.loc[table["text"].apply(len) > 10].reset_index(drop=True).head(50)
21
 
22
- prog_bar = st.progress(0)
23
- preds = []
24
 
25
- for i in range(len(table)):
26
- preds.append(classifier(table.loc[i, "text"], labels)["labels"][0])
27
- prog_bar.progress((i + 1)/len(table))
28
 
29
- table["label"] = preds
30
 
31
- st.table(table[["text", "label"]])
32
-
33
- except:
34
- st.error("File load didn't work. Make sure you upload a file containing a `text` column and a set of comma-separated labels is provided")
35
 
36
 
37
 
 
14
 
15
  if st.button("Calculate labels"):
16
 
17
+ labels_list = labels.split(",")
18
+ table = pd.read_excel(data)
19
+ table = table.loc[table["text"].apply(len) > 10].reset_index(drop=True).head(50)
 
20
 
21
+ prog_bar = st.progress(0)
22
+ preds = []
23
 
24
+ for i in range(len(table)):
25
+ preds.append(classifier(table.loc[i, "text"], labels)["labels"][0])
26
+ prog_bar.progress((i + 1)/len(table))
27
 
28
+ table["label"] = preds
29
 
30
+ st.table(table[["text", "label"]])
 
 
 
31
 
32
 
33