Spaces:
Sleeping
Sleeping
parkermoe
commited on
Commit
·
8d4900c
1
Parent(s):
66557e5
'fix path'
Browse files
app.py
CHANGED
@@ -36,19 +36,19 @@ class LSTMModel(nn.Module):
|
|
36 |
model = LSTMModel(VOCAB_SIZE, EMBEDDING_DIM, N_UNITS).to(device)
|
37 |
|
38 |
|
39 |
-
checkpoint_path = '
|
40 |
checkpoint = torch.load(checkpoint_path)
|
41 |
model.load_state_dict(checkpoint['model_state_dict'])
|
42 |
print('Loaded model from checkpoint')
|
43 |
|
44 |
def load_vocab(directory):
|
45 |
-
file_path = os.path.join(directory, '
|
46 |
with open(file_path, 'rb') as input:
|
47 |
vocab = pickle.load(input)
|
48 |
print(f"Vocabulary loaded from {file_path}")
|
49 |
return vocab
|
50 |
|
51 |
-
vocab = load_vocab('
|
52 |
|
53 |
|
54 |
|
|
|
36 |
model = LSTMModel(VOCAB_SIZE, EMBEDDING_DIM, N_UNITS).to(device)
|
37 |
|
38 |
|
39 |
+
checkpoint_path = 'checkpoint_epoch_99.pth'
|
40 |
checkpoint = torch.load(checkpoint_path)
|
41 |
model.load_state_dict(checkpoint['model_state_dict'])
|
42 |
print('Loaded model from checkpoint')
|
43 |
|
44 |
def load_vocab(directory):
|
45 |
+
file_path = os.path.join(directory, 'vocab.pkl')
|
46 |
with open(file_path, 'rb') as input:
|
47 |
vocab = pickle.load(input)
|
48 |
print(f"Vocabulary loaded from {file_path}")
|
49 |
return vocab
|
50 |
|
51 |
+
vocab = load_vocab('vocab.pkl')
|
52 |
|
53 |
|
54 |
|