Spaces:
Build error
Build error
SakibRumu commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -10,12 +10,12 @@ if not os.path.exists('model'):
|
|
| 10 |
os.makedirs('model')
|
| 11 |
|
| 12 |
# Load the pre-trained model
|
| 13 |
-
model = models.
|
| 14 |
model.fc = torch.nn.Linear(2048, 7) # Adjust for the number of emotion categories
|
| 15 |
|
| 16 |
# Load the model
|
| 17 |
try:
|
| 18 |
-
model.load_state_dict(torch.load('
|
| 19 |
print("Model loaded successfully.")
|
| 20 |
except FileNotFoundError:
|
| 21 |
print("Model file not found. Please check the path.")
|
|
|
|
| 10 |
os.makedirs('model')
|
| 11 |
|
| 12 |
# Load the pre-trained model
|
| 13 |
+
model = models.seresnet50(weights=None)
|
| 14 |
model.fc = torch.nn.Linear(2048, 7) # Adjust for the number of emotion categories
|
| 15 |
|
| 16 |
# Load the model
|
| 17 |
try:
|
| 18 |
+
model.load_state_dict(torch.load('custom_resnet50_emotion_model_full.pth')) # Adjust the path if needed
|
| 19 |
print("Model loaded successfully.")
|
| 20 |
except FileNotFoundError:
|
| 21 |
print("Model file not found. Please check the path.")
|