hunterschep commited on
Commit
206ae16
·
verified ·
1 Parent(s): 664cf5e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -5,6 +5,7 @@ from sacremoses import MosesPunctNormalizer
5
  import re
6
  import unicodedata
7
  import sys
 
8
 
9
  # -------------------------------------------------------------------
10
  # Device & model loading
@@ -76,7 +77,7 @@ def preproc_generic(text: str) -> str:
76
  # -------------------------------------------------------------------
77
  # Core translation function (Formosan <-> Chinese)
78
  # -------------------------------------------------------------------
79
-
80
  def translate(
81
  text: str,
82
  direction: str,
 
5
  import re
6
  import unicodedata
7
  import sys
8
+ import spaces
9
 
10
  # -------------------------------------------------------------------
11
  # Device & model loading
 
77
  # -------------------------------------------------------------------
78
  # Core translation function (Formosan <-> Chinese)
79
  # -------------------------------------------------------------------
80
+ @spaces.GPU(duration=180)
81
  def translate(
82
  text: str,
83
  direction: str,