Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -27,8 +27,13 @@ try:
|
|
| 27 |
"text-classification",
|
| 28 |
model="win2win/3-epochs-classifier-ver2",
|
| 29 |
device="cpu", # Force CPU for free tier
|
| 30 |
-
|
|
|
|
|
|
|
|
|
|
| 31 |
)
|
|
|
|
|
|
|
| 32 |
print("Model loaded successfully!")
|
| 33 |
except Exception as e:
|
| 34 |
print(f"Model loading failed: {str(e)}")
|
|
|
|
| 27 |
"text-classification",
|
| 28 |
model="win2win/3-epochs-classifier-ver2",
|
| 29 |
device="cpu", # Force CPU for free tier
|
| 30 |
+
device_map="auto",
|
| 31 |
+
torch_dtype=torch.float32, # Avoid mixed precision
|
| 32 |
+
offline_mode=False, # Force fresh download
|
| 33 |
+
max_retries=3
|
| 34 |
)
|
| 35 |
+
|
| 36 |
+
|
| 37 |
print("Model loaded successfully!")
|
| 38 |
except Exception as e:
|
| 39 |
print(f"Model loading failed: {str(e)}")
|