Spaces:
Running
on
Zero
Running
on
Zero
Commit
•
5c68a09
1
Parent(s):
8d6975b
Update app.py
Browse files
app.py
CHANGED
@@ -2,7 +2,7 @@ import gradio as gr
|
|
2 |
import polars as pl
|
3 |
from gradio_huggingfacehub_search import HuggingfaceHubSearch
|
4 |
import torch
|
5 |
-
|
6 |
from torch import nn
|
7 |
from transformers import AutoModel, AutoTokenizer, AutoConfig
|
8 |
from huggingface_hub import PyTorchModelHubMixin
|
@@ -31,7 +31,7 @@ model = QualityModel.from_pretrained("nvidia/quality-classifier-deberta").to(dev
|
|
31 |
model.eval()
|
32 |
|
33 |
|
34 |
-
|
35 |
def predict(texts: list[str]):
|
36 |
inputs = tokenizer(
|
37 |
texts, return_tensors="pt", padding="longest", truncation=True
|
|
|
2 |
import polars as pl
|
3 |
from gradio_huggingfacehub_search import HuggingfaceHubSearch
|
4 |
import torch
|
5 |
+
import spaces
|
6 |
from torch import nn
|
7 |
from transformers import AutoModel, AutoTokenizer, AutoConfig
|
8 |
from huggingface_hub import PyTorchModelHubMixin
|
|
|
31 |
model.eval()
|
32 |
|
33 |
|
34 |
+
@spaces.GPU
|
35 |
def predict(texts: list[str]):
|
36 |
inputs = tokenizer(
|
37 |
texts, return_tensors="pt", padding="longest", truncation=True
|