akdeniz27 commited on
Commit
87eb61d
1 Parent(s): 1f684a7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -10
app.py CHANGED
@@ -71,14 +71,14 @@ def setModel(model_checkpoint):
71
  Run_Button = st.button("Run", key=None)
72
  if Run_Button == True:
73
 
74
- zstc_pipeline = setModel(model_checkpoint)
75
- output = zstc_pipeline(sequences=selected_text, candidate_labels=selected_labels)
76
- output_labels = output["labels"]
77
- output_scores = output["scores"]
78
-
79
- st.header("Result")
80
- import plotly.graph_objects as go
81
- fig = go.Figure([go.Bar(x=output_labels, y=output_scores)])
82
- st.plotly_chart(fig, use_container_width=False, sharing="streamlit")
83
-
84
 
 
71
  Run_Button = st.button("Run", key=None)
72
  if Run_Button == True:
73
 
74
+ with st.spinner('Model is running...'):
75
+ zstc_pipeline = setModel(model_checkpoint)
76
+ output = zstc_pipeline(sequences=selected_text, candidate_labels=selected_labels)
77
+ output_labels = output["labels"]
78
+ output_scores = output["scores"]
79
+
80
+ st.header("Result")
81
+ fig = go.Figure([go.Bar(x=output_labels, y=output_scores)])
82
+ st.plotly_chart(fig, use_container_width=False, sharing="streamlit")
83
+ st.success('Done!')
84