Spaces:
Sleeping
Sleeping
File size: 1,362 Bytes
1de56de |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
#!/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.")
|