Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -22,6 +22,7 @@ from keras.layers import Conv1D, Add, MaxPooling1D, BatchNormalization
|
|
22 |
from keras.layers import Embedding, Bidirectional, LSTM, CuDNNLSTM, GlobalMaxPooling1D
|
23 |
|
24 |
import tensorflow as tf
|
|
|
25 |
|
26 |
|
27 |
def residual_block(data, filters, d_rate):
|
@@ -67,7 +68,8 @@ def get_model():
|
|
67 |
|
68 |
model2 = Model(inputs=x_input, outputs=x_output)
|
69 |
model2.compile(optimizer='adam', loss='categorical_crossentropy', metrics=['accuracy'])
|
70 |
-
|
|
|
71 |
|
72 |
return model2
|
73 |
|
|
|
22 |
from keras.layers import Embedding, Bidirectional, LSTM, CuDNNLSTM, GlobalMaxPooling1D
|
23 |
|
24 |
import tensorflow as tf
|
25 |
+
from huggingface_hub import hf_hub_url, cached_download
|
26 |
|
27 |
|
28 |
def residual_block(data, filters, d_rate):
|
|
|
68 |
|
69 |
model2 = Model(inputs=x_input, outputs=x_output)
|
70 |
model2.compile(optimizer='adam', loss='categorical_crossentropy', metrics=['accuracy'])
|
71 |
+
weights = cached_download(hf_hub_url("jonathang", "Protein_Family_CNN"))
|
72 |
+
model2.load_weights(weights)
|
73 |
|
74 |
return model2
|
75 |
|