Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -7,7 +7,7 @@ with zipfile.ZipFile('/home/user/app/models.zip', 'r') as zip_ref:
|
|
| 7 |
zip_ref.extractall(extract_path)
|
| 8 |
print(f"Extracted contents to {os.path.abspath(extract_path)}")
|
| 9 |
|
| 10 |
-
sys.path.append('/home/user/app/models')
|
| 11 |
|
| 12 |
print(sys.path)
|
| 13 |
|
|
@@ -21,13 +21,15 @@ import tensorflow_hub as hub
|
|
| 21 |
import tf_keras as keras
|
| 22 |
import pandas as pd
|
| 23 |
from tensorflow.keras.models import load_model
|
| 24 |
-
from official.nlp.data import classifier_data_lib
|
| 25 |
-
from official.nlp.tools import tokenization
|
|
|
|
|
|
|
| 26 |
import joblib
|
| 27 |
|
| 28 |
import gradio as gr
|
| 29 |
|
| 30 |
-
model = load_model('
|
| 31 |
|
| 32 |
vocab_file = model.resolved_object.vocab_file.asset_path.numpy()
|
| 33 |
do_lower_case = model.resolved_object.do_lower_case.numpy()
|
|
|
|
| 7 |
zip_ref.extractall(extract_path)
|
| 8 |
print(f"Extracted contents to {os.path.abspath(extract_path)}")
|
| 9 |
|
| 10 |
+
#sys.path.append('/home/user/app/models')
|
| 11 |
|
| 12 |
print(sys.path)
|
| 13 |
|
|
|
|
| 21 |
import tf_keras as keras
|
| 22 |
import pandas as pd
|
| 23 |
from tensorflow.keras.models import load_model
|
| 24 |
+
#from official.nlp.data import classifier_data_lib
|
| 25 |
+
#from official.nlp.tools import tokenization
|
| 26 |
+
import classifier_data_lib
|
| 27 |
+
import tokenization
|
| 28 |
import joblib
|
| 29 |
|
| 30 |
import gradio as gr
|
| 31 |
|
| 32 |
+
model = load_model('ISCO-Coder-BERT.h5', custom_objects={'KerasLayer': hub.KerasLayer})
|
| 33 |
|
| 34 |
vocab_file = model.resolved_object.vocab_file.asset_path.numpy()
|
| 35 |
do_lower_case = model.resolved_object.do_lower_case.numpy()
|