w11wo commited on
Commit
ed86205
β€’
1 Parent(s): 3017b00

added error msg

Browse files
Files changed (1) hide show
  1. app.py +7 -2
app.py CHANGED
@@ -84,7 +84,11 @@ def main():
84
  else:
85
  # render masked language modeling table
86
  mlm_result = mask_api(inputs=user_input)
87
- # st.write(mlm_result)
 
 
 
 
88
  mlm_df = pd.DataFrame(mlm_result)
89
  mlm_df.drop(columns=["token", "token_str"], inplace=True)
90
  mlm_df_styled = mlm_df.copy(deep=False)
@@ -109,4 +113,5 @@ def main():
109
  display_table(sa_df_styled, "πŸ€” By saying that, I guess you are feeling..")
110
 
111
 
112
- main()
 
84
  else:
85
  # render masked language modeling table
86
  mlm_result = mask_api(inputs=user_input)
87
+
88
+ if mlm_result == None:
89
+ st.write("Model is loading. Please try again later...")
90
+ return
91
+
92
  mlm_df = pd.DataFrame(mlm_result)
93
  mlm_df.drop(columns=["token", "token_str"], inplace=True)
94
  mlm_df_styled = mlm_df.copy(deep=False)
113
  display_table(sa_df_styled, "πŸ€” By saying that, I guess you are feeling..")
114
 
115
 
116
+ if __name__ == "__main__":
117
+ main()