run_evaluation fix
Browse files- scripts/eval.py +15 -6
scripts/eval.py
CHANGED
|
@@ -354,13 +354,14 @@ def run_evaluation(args) -> Dict[str, Any]:
|
|
| 354 |
logger.info(f"Few-shot examples: {args.num_fewshot}")
|
| 355 |
logger.info(f"Batch size: {args.batch_size}")
|
| 356 |
|
| 357 |
-
# Debug information
|
| 358 |
print("Type of model being passed:", type(model))
|
| 359 |
-
|
| 360 |
-
|
| 361 |
-
|
| 362 |
-
|
| 363 |
-
|
|
|
|
| 364 |
|
| 365 |
# Ensure model is properly initialized
|
| 366 |
if hasattr(model, '_model') and model._model is not None:
|
|
@@ -379,6 +380,14 @@ def run_evaluation(args) -> Dict[str, Any]:
|
|
| 379 |
except Exception as e:
|
| 380 |
logger.error(f"Evaluation failed with error: {e}")
|
| 381 |
logger.error("This might be due to model registration or configuration issues")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 382 |
raise
|
| 383 |
|
| 384 |
logger.info("Evaluation completed successfully")
|
|
|
|
| 354 |
logger.info(f"Few-shot examples: {args.num_fewshot}")
|
| 355 |
logger.info(f"Batch size: {args.batch_size}")
|
| 356 |
|
| 357 |
+
# Debug information - FIXED
|
| 358 |
print("Type of model being passed:", type(model))
|
| 359 |
+
if hasattr(model, '_model') and hasattr(model._model, 'config'):
|
| 360 |
+
print("Model config:", model._model.config)
|
| 361 |
+
elif hasattr(model, 'config'):
|
| 362 |
+
print("Model config:", model.config)
|
| 363 |
+
else:
|
| 364 |
+
print("Model config: Not accessible")
|
| 365 |
|
| 366 |
# Ensure model is properly initialized
|
| 367 |
if hasattr(model, '_model') and model._model is not None:
|
|
|
|
| 380 |
except Exception as e:
|
| 381 |
logger.error(f"Evaluation failed with error: {e}")
|
| 382 |
logger.error("This might be due to model registration or configuration issues")
|
| 383 |
+
|
| 384 |
+
# Additional debugging
|
| 385 |
+
logger.error(f"Model type: {type(model)}")
|
| 386 |
+
if hasattr(model, '_model'):
|
| 387 |
+
logger.error(f"Internal model type: {type(model._model)}")
|
| 388 |
+
if hasattr(model._model, 'config'):
|
| 389 |
+
logger.error(f"Internal model config type: {type(model._model.config)}")
|
| 390 |
+
|
| 391 |
raise
|
| 392 |
|
| 393 |
logger.info("Evaluation completed successfully")
|