Minjun Kang commited on
Commit
d728005
Β·
1 Parent(s): 9d20977

initial code

Browse files
Files changed (2) hide show
  1. app.py +2 -0
  2. requirements.txt +3 -1
app.py CHANGED
@@ -22,6 +22,7 @@ import matplotlib.pyplot as plt
22
  import joblib
23
  import torch
24
  import gradio as gr
 
25
 
26
  warnings.filterwarnings("ignore")
27
 
@@ -132,6 +133,7 @@ def load_t5():
132
 
133
 
134
  # ── Feature extraction ────────────────────────────────────────────────────────
 
135
  def extract_t5_feature(sequence: str) -> np.ndarray:
136
  """
137
  Return mean-pooled ProtT5-XL embedding for a single sequence.
 
22
  import joblib
23
  import torch
24
  import gradio as gr
25
+ import spaces
26
 
27
  warnings.filterwarnings("ignore")
28
 
 
133
 
134
 
135
  # ── Feature extraction ────────────────────────────────────────────────────────
136
+ @spaces.GPU
137
  def extract_t5_feature(sequence: str) -> np.ndarray:
138
  """
139
  Return mean-pooled ProtT5-XL embedding for a single sequence.
requirements.txt CHANGED
@@ -1,4 +1,6 @@
1
- # torch/torchvision/torchaudio are installed by Dockerfile with CPU wheel
 
 
2
  transformers>=5.0.0
3
  sentencepiece # ProtT5 tokenizer backend
4
 
 
1
+ # sdk: gradio spaces build from this file only (Dockerfile is not used)
2
+ torch
3
+ spaces
4
  transformers>=5.0.0
5
  sentencepiece # ProtT5 tokenizer backend
6