#!/usr/bin/env python3 """ Simple test script for the simplified pipeline approach """ import os import sys from pathlib import Path # Add project root to path project_root = Path(__file__).parent sys.path.insert(0, str(project_root)) def test_simple_training_script(): """Test the simplified training script""" print("šŸ” Testing simplified training script...") try: # Test that the training script can be imported from scripts.training.train import main as train_main print("āœ… Training script imported successfully") # Test config loading from config.train_smollm3_h100_lightweight import config as h100_config print("āœ… H100 lightweight config loaded successfully") print(f" Model: {h100_config.model_name}") print(f" Batch size: {h100_config.batch_size}") print(f" Sample size: {h100_config.sample_size}") return True except Exception as e: print(f"āŒ Training script test failed: {e}") return False def test_config_files(): """Test that all required config files exist""" print("\nšŸ” Testing config files...") config_files = [ "config/train_smollm3_h100_lightweight.py", "config/train_smollm3_openhermes_fr_a100_large.py", "config/train_smollm3_openhermes_fr_a100_multiple_passes.py" ] for config_file in config_files: if os.path.exists(config_file): print(f"āœ… {config_file}") else: print(f"āŒ {config_file} not found") return False return True def test_scripts(): """Test that all required scripts exist""" print("\nšŸ” Testing scripts...") script_files = [ "scripts/training/train.py", "scripts/trackio_tonic/deploy_trackio_space.py", "scripts/trackio_tonic/configure_trackio.py", "scripts/dataset_tonic/setup_hf_dataset.py", "scripts/model_tonic/push_to_huggingface.py" ] for script_file in script_files: if os.path.exists(script_file): print(f"āœ… {script_file}") else: print(f"āŒ {script_file} not found") return False return True def test_launch_script(): """Test that the launch script exists and is executable""" print("\nšŸ” Testing launch script...") launch_script = "launch.sh" if os.path.exists(launch_script): print(f"āœ… {launch_script} exists") # Check if it's executable if os.access(launch_script, os.X_OK): print(f"āœ… {launch_script} is executable") else: print(f"āš ļø {launch_script} is not executable (run: chmod +x launch.sh)") return True else: print(f"āŒ {launch_script} not found") return False def main(): """Run all tests""" print("šŸš€ Testing Simplified SmolLM3 Pipeline") print("=" * 50) tests = [ test_simple_training_script, test_config_files, test_scripts, test_launch_script ] passed = 0 total = len(tests) for test in tests: if test(): passed += 1 else: print(f"āŒ Test failed: {test.__name__}") print(f"\n{'='*50}") print(f"šŸ“Š Test Results: {passed}/{total} tests passed") if passed == total: print("šŸŽ‰ All tests passed! Simplified pipeline is ready to run.") print("\nšŸš€ To run the pipeline:") print("1. chmod +x launch.sh") print("2. ./launch.sh") return 0 else: print("āŒ Some tests failed. Please fix the issues before running the pipeline.") return 1 if __name__ == "__main__": exit(main())