File size: 1,240 Bytes
8a3c5dd |
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 |
#!/usr/bin/env python3
"""
Quick test to verify the model loading fix works
"""
def test_model_loading_fix():
"""Test that the accelerate conflict is resolved"""
print("π Model Loading Fix Verification")
print("=" * 40)
# Show the specific error that was fixed
print("β Previous Error:")
print(" 'The model has been loaded with `accelerate` and therefore")
print(" cannot be moved to a specific device. Please discard the")
print(" `device` argument when creating your pipeline object.'")
print("\nπ§ Fix Applied:")
print(" OLD: device_map='cpu', device=-1")
print(" NEW: device_map='auto', no device specified")
print("\nβ
Expected Result:")
print(" β’ Model loads successfully with accelerate")
print(" β’ No device conflicts")
print(" β’ Auto-optimization for available hardware")
print(" β’ Exit from demo mode")
print("\nπ Next Steps:")
print(" 1. Deploy to HF Spaces")
print(" 2. Check logs for successful model loading")
print(" 3. Test /health endpoint (should show 'healthy')")
print(" 4. Test /v1/chat/completions endpoint")
if __name__ == "__main__":
test_model_loading_fix()
|