fix bug in bio_embedding usage
Browse files
app.py
CHANGED
@@ -99,8 +99,10 @@ def display_dti():
|
|
99 |
if selected_encoder == 'SeqVec':
|
100 |
from bio_embeddings.embed import SeqVecEmbedder
|
101 |
encoder = SeqVecEmbedder()
|
102 |
-
|
103 |
-
|
|
|
|
|
104 |
#from huggingface_hub import hf_hub_download
|
105 |
#precomputed_embs = f'{selected_encoder}_encoding.csv'
|
106 |
#REPO_ID = "emmas96/Lenselink"
|
@@ -116,13 +118,17 @@ def display_dti():
|
|
116 |
elif selected_encoder == 'ESM-1b':
|
117 |
from bio_embeddings.embed import ESM1bEmbedder
|
118 |
encoder = ESM1bEmbedder()
|
119 |
-
|
120 |
-
|
|
|
|
|
121 |
elif selected_encoder == 'ProtT5':
|
122 |
from bio_embeddings.embed import ProtTransT5XLU50Embedder
|
123 |
encoder = ProtTransT5XLU50Embedder()
|
124 |
-
|
125 |
-
|
|
|
|
|
126 |
else:
|
127 |
st.write('No pre-trained version of HyperPCM is available for the chosen encoder.')
|
128 |
embedding = None
|
|
|
99 |
if selected_encoder == 'SeqVec':
|
100 |
from bio_embeddings.embed import SeqVecEmbedder
|
101 |
encoder = SeqVecEmbedder()
|
102 |
+
embeddings = encoder.embed_batch([sequence])
|
103 |
+
for emb in embeddings:
|
104 |
+
embedding = encoder.reduce_per_protein(emb)
|
105 |
+
break
|
106 |
#from huggingface_hub import hf_hub_download
|
107 |
#precomputed_embs = f'{selected_encoder}_encoding.csv'
|
108 |
#REPO_ID = "emmas96/Lenselink"
|
|
|
118 |
elif selected_encoder == 'ESM-1b':
|
119 |
from bio_embeddings.embed import ESM1bEmbedder
|
120 |
encoder = ESM1bEmbedder()
|
121 |
+
embeddings = encoder.embed_batch([sequence])
|
122 |
+
for emb in embeddings:
|
123 |
+
embedding = encoder.reduce_per_protein(emb)
|
124 |
+
break
|
125 |
elif selected_encoder == 'ProtT5':
|
126 |
from bio_embeddings.embed import ProtTransT5XLU50Embedder
|
127 |
encoder = ProtTransT5XLU50Embedder()
|
128 |
+
embeddings = encoder.embed_batch([sequence])
|
129 |
+
for emb in embeddings:
|
130 |
+
embedding = encoder.reduce_per_protein(emb)
|
131 |
+
break
|
132 |
else:
|
133 |
st.write('No pre-trained version of HyperPCM is available for the chosen encoder.')
|
134 |
embedding = None
|