Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,10 +1,11 @@
|
|
1 |
import os
|
2 |
-
|
3 |
import gradio as gr
|
4 |
from transformers import pipeline
|
5 |
|
6 |
classifier = pipeline("zero-shot-classification", model=os.getenv('MODEL'))
|
7 |
|
|
|
8 |
def classify(text, labels):
|
9 |
labels = labels.split(',')
|
10 |
if not text or not labels:
|
|
|
1 |
import os
|
2 |
+
import spaces
|
3 |
import gradio as gr
|
4 |
from transformers import pipeline
|
5 |
|
6 |
classifier = pipeline("zero-shot-classification", model=os.getenv('MODEL'))
|
7 |
|
8 |
+
@spaces.GPU(duration=120)
|
9 |
def classify(text, labels):
|
10 |
labels = labels.split(',')
|
11 |
if not text or not labels:
|