PierreHanna commited on
Commit
ab53756
Β·
1 Parent(s): 3b76b78

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -7
app.py CHANGED
@@ -14,15 +14,18 @@ from huggingface_hub import hf_hub_download
14
  encoder_text_path = hf_hub_download(repo_id="PierreHanna/TextRetrieval", repo_type="space", filename="encoder_text_retrievaltext_bmg_221022_54.h5",
15
  use_auth_token=os.environ['TOKEN'])
16
 
17
- #use_auth_token="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")
18
-
19
-
20
  # NO GPU
21
  os.environ['CUDA_VISIBLE_DEVICES'] = '-1'
22
  os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
23
 
24
 
25
 
 
 
 
 
 
 
26
  def make_bert_preprocess_model(sentence_features, tfhub_handle_preprocess, seq_length=128):
27
  """Returns Model mapping string features to BERT inputs.
28
  """
@@ -42,10 +45,6 @@ def make_bert_preprocess_model(sentence_features, tfhub_handle_preprocess, seq_l
42
  model_inputs = packer(truncated_segments)
43
  return tf.keras.Model(input_segments, model_inputs)
44
 
45
- python_path = hf_hub_download(repo_id="PierreHanna/TextRetrieval", repo_type="space", filename="models.py",
46
- use_auth_token=os.environ['TOKEN'])
47
- from models import *
48
-
49
  def process(prompt, lang):
50
 
51
  # Getting prompt user
 
14
  encoder_text_path = hf_hub_download(repo_id="PierreHanna/TextRetrieval", repo_type="space", filename="encoder_text_retrievaltext_bmg_221022_54.h5",
15
  use_auth_token=os.environ['TOKEN'])
16
 
 
 
 
17
  # NO GPU
18
  os.environ['CUDA_VISIBLE_DEVICES'] = '-1'
19
  os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
20
 
21
 
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 make_bert_preprocess_model(sentence_features, tfhub_handle_preprocess, seq_length=128):
30
  """Returns Model mapping string features to BERT inputs.
31
  """
 
45
  model_inputs = packer(truncated_segments)
46
  return tf.keras.Model(input_segments, model_inputs)
47
 
 
 
 
 
48
  def process(prompt, lang):
49
 
50
  # Getting prompt user