Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,9 +3,6 @@ import torch
|
|
3 |
|
4 |
from germantoenglish import Seq2SeqTransformer, translate, greedy_decode
|
5 |
|
6 |
-
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
|
7 |
-
model = model.load_state_dict(torch.load('./transformer_model.pth', map_location=device))
|
8 |
-
model.eval()
|
9 |
|
10 |
if __name__ == "__main__":
|
11 |
iface = gr.Interface(
|
|
|
3 |
|
4 |
from germantoenglish import Seq2SeqTransformer, translate, greedy_decode
|
5 |
|
|
|
|
|
|
|
6 |
|
7 |
if __name__ == "__main__":
|
8 |
iface = gr.Interface(
|