Spaces:
Runtime error
Runtime error
Commit Β·
dc96ac0
1
Parent(s): 8d66428
Update app.py
Browse files
app.py
CHANGED
|
@@ -22,11 +22,11 @@ os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
|
|
| 22 |
|
| 23 |
|
| 24 |
python_path = hf_hub_download(repo_id="PierreHanna/TextRetrieval", repo_type="space", filename="models.py",
|
| 25 |
-
use_auth_token=os.environ['TOKEN'])
|
| 26 |
-
from models import *
|
| 27 |
|
| 28 |
|
| 29 |
-
def
|
| 30 |
"""Returns Model mapping string features to BERT inputs.
|
| 31 |
"""
|
| 32 |
|
|
@@ -60,7 +60,7 @@ def process(prompt, lang):
|
|
| 60 |
TOP = 10
|
| 61 |
|
| 62 |
|
| 63 |
-
bert_preprocess_model =
|
| 64 |
bert_model = hub.KerasLayer(tfhub_handle_encoder)
|
| 65 |
|
| 66 |
now = datetime.datetime.now()
|
|
|
|
| 22 |
|
| 23 |
|
| 24 |
python_path = hf_hub_download(repo_id="PierreHanna/TextRetrieval", repo_type="space", filename="models.py",
|
| 25 |
+
use_auth_token=os.environ['TOKEN'], subfolder="ph")
|
| 26 |
+
from ph.models import *
|
| 27 |
|
| 28 |
|
| 29 |
+
def make_preprocess_model(sentence_features, tfhub_handle_preprocess, seq_length=128):
|
| 30 |
"""Returns Model mapping string features to BERT inputs.
|
| 31 |
"""
|
| 32 |
|
|
|
|
| 60 |
TOP = 10
|
| 61 |
|
| 62 |
|
| 63 |
+
bert_preprocess_model = make_preprocess_model(['my_input'], tfhub_handle_preprocess, seq_length = MAX_LENGTH)
|
| 64 |
bert_model = hub.KerasLayer(tfhub_handle_encoder)
|
| 65 |
|
| 66 |
now = datetime.datetime.now()
|