tdoehmen commited on
Commit
d9c57da
·
1 Parent(s): 2d065e3

add logging

Browse files
Files changed (1) hide show
  1. app.py +28 -16
app.py CHANGED
@@ -64,23 +64,35 @@ def run_evaluation(model_name):
64
  pred_path = Path(output_dir) / pred_filename
65
  results.append(f"Prediction will be saved to: {pred_path}")
66
 
 
 
 
67
  # Run prediction
68
- results.append("Starting prediction...")
69
- predict(
70
- dataset_path=dataset_path,
71
- table_meta_path=table_meta_path,
72
- output_dir=output_dir,
73
- prompt_format=prompt_format,
74
- stop_tokens=stop_tokens,
75
- max_tokens=max_tokens,
76
- temperature=temperature,
77
- num_beams=num_beams,
78
- manifest_client=manifest_client,
79
- manifest_engine=manifest_engine,
80
- manifest_connection=manifest_connection,
81
- overwrite_manifest=overwrite_manifest,
82
- parallel=parallel
83
- )
 
 
 
 
 
 
 
 
 
84
  results.append("Prediction completed.")
85
 
86
  # Run evaluation
 
64
  pred_path = Path(output_dir) / pred_filename
65
  results.append(f"Prediction will be saved to: {pred_path}")
66
 
67
+ # Debug: Print predict function signature
68
+ yield f"Predict function signature: {inspect.signature(predict)}"
69
+
70
  # Run prediction
71
+ yield "Starting prediction..."
72
+ try:
73
+ predict(
74
+ dataset_path=dataset_path,
75
+ table_meta_path=table_meta_path,
76
+ output_dir=output_dir,
77
+ prompt_format=prompt_format,
78
+ stop_tokens=stop_tokens,
79
+ max_tokens=max_tokens,
80
+ temperature=temperature,
81
+ num_beams=num_beams,
82
+ manifest_client=manifest_client,
83
+ manifest_engine=manifest_engine,
84
+ manifest_connection=manifest_connection,
85
+ overwrite_manifest=overwrite_manifest,
86
+ parallel=parallel
87
+ )
88
+ except TypeError as e:
89
+ yield f"TypeError in predict function: {str(e)}"
90
+ yield "Attempting to call predict with only expected arguments..."
91
+ # Try calling predict with only the arguments it expects
92
+ predict_args = inspect.getfullargspec(predict).args
93
+ filtered_args = {k: v for k, v in locals().items() if k in predict_args}
94
+ predict(**filtered_args)
95
+
96
  results.append("Prediction completed.")
97
 
98
  # Run evaluation