Scezui commited on
Commit
9d7e558
·
1 Parent(s): 8cbfe3e

prediction

Browse files
Files changed (1) hide show
  1. app.py +5 -1
app.py CHANGED
@@ -165,7 +165,11 @@ def predict_files(filenames):
165
 
166
  if os.path.exists(file_path):
167
  # Call make_predictions automatically
168
- prediction_result = make_predictions([file_path]) # Pass file_path as a list
 
 
 
 
169
  prediction_results.append(prediction_result[0]) # Append only the first prediction result
170
  prediction_results_copy = copy.deepcopy(prediction_results)
171
 
 
165
 
166
  if os.path.exists(file_path):
167
  # Call make_predictions automatically
168
+ prediction_result = make_predictions([file_path])
169
+ if isinstance(prediction_result, list) and len(prediction_result) > 0:
170
+ prediction_results.append(prediction_result[0]) # Append only the first prediction result
171
+ else:
172
+ print(f"Error making prediction for {file}: {prediction_result}")
173
  prediction_results.append(prediction_result[0]) # Append only the first prediction result
174
  prediction_results_copy = copy.deepcopy(prediction_results)
175