Spaces:
Running
on
Zero
Running
on
Zero
donbr
commited on
Commit
·
55e8d79
1
Parent(s):
3e2b7aa
reduce gpu duration and add numpy and gradio dependencies
Browse files- app.py +1 -1
- requirements.txt +3 -1
app.py
CHANGED
|
@@ -147,7 +147,7 @@ def load_model():
|
|
| 147 |
model.eval()
|
| 148 |
return model
|
| 149 |
|
| 150 |
-
@spaces.GPU
|
| 151 |
def gradio_interface_function(template, text, is_example):
|
| 152 |
try:
|
| 153 |
if len(tokenizer.tokenize(text)) > MAX_INPUT_SIZE:
|
|
|
|
| 147 |
model.eval()
|
| 148 |
return model
|
| 149 |
|
| 150 |
+
@spaces.GPU
|
| 151 |
def gradio_interface_function(template, text, is_example):
|
| 152 |
try:
|
| 153 |
if len(tokenizer.tokenize(text)) > MAX_INPUT_SIZE:
|
requirements.txt
CHANGED
|
@@ -1,4 +1,6 @@
|
|
| 1 |
transformers==4.41.2
|
| 2 |
torch==2.2.2
|
| 3 |
accelerate
|
| 4 |
-
spaces>=0.1.0
|
|
|
|
|
|
|
|
|
| 1 |
transformers==4.41.2
|
| 2 |
torch==2.2.2
|
| 3 |
accelerate
|
| 4 |
+
spaces>=0.1.0
|
| 5 |
+
numpy<2.0
|
| 6 |
+
gradio>=4.0.0
|