Spaces:
Running on Zero
Running on Zero
Minjun Kang commited on
Commit Β·
d728005
1
Parent(s): 9d20977
initial code
Browse files- app.py +2 -0
- 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 |
-
#
|
|
|
|
|
|
|
| 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 |
|