#!/usr/bin/env python3 """ Simple test to verify the fixes work. """ def test_syntax(): """Test that all Python files have valid syntax.""" import ast files_to_test = [ "scripts/train_lora.py", "scripts/train.py", "scripts/deploy_demo_space.py" ] for file_path in files_to_test: try: with open(file_path, 'r', encoding='utf-8') as f: content = f.read() ast.parse(content) print(f"โœ… {file_path} - syntax valid") except SyntaxError as e: print(f"โŒ {file_path} - syntax error: {e}") return False except Exception as e: print(f"โŒ {file_path} - error: {e}") return False return True if __name__ == "__main__": print("๐Ÿงช Testing syntax...") if test_syntax(): print("\n๐ŸŽ‰ All files have valid syntax!") print("\nKey fixes applied:") print("1. โœ… Fixed WandbCallback error by using report_to=['trackio']") print("2. โœ… Fixed f-string syntax errors in deploy_demo_space.py") print("3. โœ… Removed stray } characters from json.dumps calls") print("4. โœ… Fixed missing closing parenthesis") print("\nThe training should now work correctly!") else: print("\nโŒ Some files have syntax errors.")