Spaces:
Running
Running
kovacsvi
commited on
Commit
·
cf9ad46
1
Parent(s):
1ea7a80
zeroGPU
Browse files- interfaces/cap_minor_media.py +2 -0
- requirements.txt +1 -0
interfaces/cap_minor_media.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
|
3 |
import os
|
4 |
import torch
|
@@ -56,6 +57,7 @@ def check_huggingface_path(checkpoint_path: str):
|
|
56 |
def build_huggingface_path(language: str, domain: str):
|
57 |
return ("poltextlab/xlm-roberta-large-pooled-cap-media", "poltextlab/xlm-roberta-large-pooled-cap-minor-v3")
|
58 |
|
|
|
59 |
def predict(text, major_model_id, minor_model_id, tokenizer_id, HF_TOKEN=None):
|
60 |
device = torch.device("cpu")
|
61 |
|
|
|
1 |
import gradio as gr
|
2 |
+
import spaces
|
3 |
|
4 |
import os
|
5 |
import torch
|
|
|
57 |
def build_huggingface_path(language: str, domain: str):
|
58 |
return ("poltextlab/xlm-roberta-large-pooled-cap-media", "poltextlab/xlm-roberta-large-pooled-cap-minor-v3")
|
59 |
|
60 |
+
@spaces.GPU
|
61 |
def predict(text, major_model_id, minor_model_id, tokenizer_id, HF_TOKEN=None):
|
62 |
device = torch.device("cpu")
|
63 |
|
requirements.txt
CHANGED
@@ -8,3 +8,4 @@ huspacy
|
|
8 |
numpy==1.26.4
|
9 |
safetensors
|
10 |
huggingface_hub
|
|
|
|
8 |
numpy==1.26.4
|
9 |
safetensors
|
10 |
huggingface_hub
|
11 |
+
spaces
|