kovacsvi commited on
Commit
daf3535
·
1 Parent(s): eb37d39

zeroGPU for cap task

Browse files
Files changed (1) hide show
  1. interfaces/cap.py +1 -0
interfaces/cap.py CHANGED
@@ -82,6 +82,7 @@ def build_huggingface_path(language: str, domain: str):
82
  else:
83
  return "poltextlab/xlm-roberta-large-pooled-cap"
84
 
 
85
  def predict(text, model_id, tokenizer_id):
86
  device = torch.device("cpu")
87
  model = AutoModelForSequenceClassification.from_pretrained(model_id, low_cpu_mem_usage=True, device_map="auto", offload_folder="offload", token=HF_TOKEN)
 
82
  else:
83
  return "poltextlab/xlm-roberta-large-pooled-cap"
84
 
85
+ @spaces.GPU(duration=5)
86
  def predict(text, model_id, tokenizer_id):
87
  device = torch.device("cpu")
88
  model = AutoModelForSequenceClassification.from_pretrained(model_id, low_cpu_mem_usage=True, device_map="auto", offload_folder="offload", token=HF_TOKEN)