Spaces:
Runtime error
Runtime error
ai-forever
commited on
Commit
•
970d3bb
1
Parent(s):
629af13
Update app.py
Browse files
app.py
CHANGED
@@ -22,6 +22,7 @@ article = (
|
|
22 |
|
23 |
device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
24 |
fp16 = device != 'cpu'
|
|
|
25 |
|
26 |
def transl(text, src='en', dest='hy' ):
|
27 |
return translator.translate(text, src=src, dest=dest).text
|
|
|
22 |
|
23 |
device = "cuda:0" if torch.cuda.is_available() else "cpu"
|
24 |
fp16 = device != 'cpu'
|
25 |
+
model.to(device).eval()
|
26 |
|
27 |
def transl(text, src='en', dest='hy' ):
|
28 |
return translator.translate(text, src=src, dest=dest).text
|