Spaces:
Running
Running
Update models/LSTM.py
Browse files- models/LSTM.py +2 -2
models/LSTM.py
CHANGED
@@ -7,7 +7,7 @@ from models.preprocess_stage.preprocess_lstm import preprocess_lstm
|
|
7 |
EMBEDDING_DIM = 128
|
8 |
HIDDEN_SIZE = 16
|
9 |
MAX_LEN = 125
|
10 |
-
DEVICE='cpu'
|
11 |
|
12 |
embedding_matrix = np.load('models/datasets/embedding_matrix.npy')
|
13 |
embedding_layer = nn.Embedding.from_pretrained(torch.FloatTensor(embedding_matrix))
|
@@ -80,7 +80,7 @@ def predict_3(text):
|
|
80 |
|
81 |
preprocessed_text = preprocess_lstm(text, MAX_LEN=MAX_LEN)
|
82 |
|
83 |
-
model.to(DEVICE)
|
84 |
model.eval()
|
85 |
predict, attention = model(torch.tensor(preprocessed_text).unsqueeze(0))
|
86 |
|
|
|
7 |
EMBEDDING_DIM = 128
|
8 |
HIDDEN_SIZE = 16
|
9 |
MAX_LEN = 125
|
10 |
+
# DEVICE='cpu'
|
11 |
|
12 |
embedding_matrix = np.load('models/datasets/embedding_matrix.npy')
|
13 |
embedding_layer = nn.Embedding.from_pretrained(torch.FloatTensor(embedding_matrix))
|
|
|
80 |
|
81 |
preprocessed_text = preprocess_lstm(text, MAX_LEN=MAX_LEN)
|
82 |
|
83 |
+
# model.to(DEVICE)
|
84 |
model.eval()
|
85 |
predict, attention = model(torch.tensor(preprocessed_text).unsqueeze(0))
|
86 |
|