Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -90,7 +90,7 @@ def train_step(file=None, start_idx=0):
|
|
90 |
try:
|
91 |
success, message = train_batch(dataloader)
|
92 |
if not success:
|
93 |
-
return start_idx, "./checkpoint/model.pt # Trả về start_idx nếu lỗi xảy ra
|
94 |
|
95 |
except HTMLError as e:
|
96 |
print(e)
|
@@ -105,7 +105,7 @@ def train_step(file=None, start_idx=0):
|
|
105 |
if not os.path.exists('./checkpoint'):
|
106 |
os.makedirs('./checkpoint')
|
107 |
torch.save(model.state_dict(), "./checkpoint/model.pt")
|
108 |
-
return start_idx, "./checkpoint/model.pt
|
109 |
|
110 |
|
111 |
if __name__ == "__main__":
|
|
|
90 |
try:
|
91 |
success, message = train_batch(dataloader)
|
92 |
if not success:
|
93 |
+
return start_idx, "./checkpoint/model.pt" # Trả về start_idx nếu lỗi xảy ra
|
94 |
|
95 |
except HTMLError as e:
|
96 |
print(e)
|
|
|
105 |
if not os.path.exists('./checkpoint'):
|
106 |
os.makedirs('./checkpoint')
|
107 |
torch.save(model.state_dict(), "./checkpoint/model.pt")
|
108 |
+
return start_idx, "./checkpoint/model.pt"
|
109 |
|
110 |
|
111 |
if __name__ == "__main__":
|