Spaces:
Running
Running
OOFMAN29803
commited on
Commit
•
6703501
1
Parent(s):
a1c209b
Update app.py
Browse files
app.py
CHANGED
@@ -183,7 +183,7 @@ def load_model_and_data():
|
|
183 |
print(f"Using device: {device}")
|
184 |
|
185 |
# Load the dataset (for vocabulary)
|
186 |
-
file_path = '
|
187 |
dataset = TranslationDataset(file_path)
|
188 |
|
189 |
# Model hyperparameters (make sure these match your trained model)
|
@@ -203,7 +203,7 @@ def load_model_and_data():
|
|
203 |
).to(device)
|
204 |
|
205 |
# Load the trained model
|
206 |
-
model.load_state_dict(torch.load('
|
207 |
model.eval()
|
208 |
|
209 |
return model, dataset.src_vocab, dataset.tgt_vocab, device
|
|
|
183 |
print(f"Using device: {device}")
|
184 |
|
185 |
# Load the dataset (for vocabulary)
|
186 |
+
file_path = 'newcode15M.txt' # Replace with the path to your dataset file
|
187 |
dataset = TranslationDataset(file_path)
|
188 |
|
189 |
# Model hyperparameters (make sure these match your trained model)
|
|
|
203 |
).to(device)
|
204 |
|
205 |
# Load the trained model
|
206 |
+
model.load_state_dict(torch.load('AllOneLM.pth', map_location=device))
|
207 |
model.eval()
|
208 |
|
209 |
return model, dataset.src_vocab, dataset.tgt_vocab, device
|