Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -51,7 +51,7 @@ model = CustomDialoGPT(vocab_size, n_embd, n_head, n_layer)
|
|
51 |
# Download and load model weights
|
52 |
try:
|
53 |
pth_filepath = hf_hub_download(repo_id=model_repo, filename=model_filename)
|
54 |
-
checkpoint = torch.load(pth_filepath, map_location=device)
|
55 |
|
56 |
# Handle different checkpoint saving formats if needed.
|
57 |
# If your checkpoint is just the state_dict, load it directly.
|
|
|
51 |
# Download and load model weights
|
52 |
try:
|
53 |
pth_filepath = hf_hub_download(repo_id=model_repo, filename=model_filename)
|
54 |
+
checkpoint = torch.load(pth_filepath, map_location=device, weights_only=True)
|
55 |
|
56 |
# Handle different checkpoint saving formats if needed.
|
57 |
# If your checkpoint is just the state_dict, load it directly.
|