jaifar530 commited on
Commit
39e6ad2
·
unverified ·
1 Parent(s): 6bc2c46
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -233,9 +233,13 @@ def AI_vs_AI_RandomForest_88_Samples(df):
233
  with open('AI_vs_AI_RandomForest_88_Samples.pkl', 'wb') as file:
234
  file.write(response.content)
235
 
236
- # At this point, the pickle file should exist, either it was already there, or it has been downloaded and extracted.
237
  with open('AI_vs_AI_RandomForest_88_Samples.pkl', 'rb') as file:
238
  clf_loaded = pickle.load(file)
 
 
 
 
239
 
240
  input_features = df['paragraph'].apply(extract_features_AI_vs_AI_RandomForest_88_Samples)
241
  try:
 
233
  with open('AI_vs_AI_RandomForest_88_Samples.pkl', 'wb') as file:
234
  file.write(response.content)
235
 
236
+ try:
237
  with open('AI_vs_AI_RandomForest_88_Samples.pkl', 'rb') as file:
238
  clf_loaded = pickle.load(file)
239
+ except Exception as e:
240
+ st.write(f"An error occurred: {str(e)}")
241
+ return # This will exit the function
242
+
243
 
244
  input_features = df['paragraph'].apply(extract_features_AI_vs_AI_RandomForest_88_Samples)
245
  try: