Dimitre commited on
Commit
f91fe8a
·
1 Parent(s): 32b0b31

Adding module path

Browse files
Files changed (2) hide show
  1. app.py +4 -2
  2. requirements.txt +0 -1
app.py CHANGED
@@ -1,10 +1,12 @@
1
  # Workaround to install the lib without "setup.py"
 
2
  from git import Repo
3
- Repo.clone_from("https://github.com/dimitreOliveira/hub.git", "./")
 
4
 
5
  import gradio as gr
6
  import tensorflow_text as text # Registers the ops. (needed for "bert_preprocessor")
7
- from tensorflow_hub.hf_utils import pull_from_hub
8
  from sklearn.metrics.pairwise import cosine_similarity
9
 
10
  model = pull_from_hub(repo_id="Dimitre/universal-sentence-encoder")
 
1
  # Workaround to install the lib without "setup.py"
2
+ import sys
3
  from git import Repo
4
+ Repo.clone_from("https://github.com/dimitreOliveira/hub.git", "./hub")
5
+ sys.path.append("/hub")
6
 
7
  import gradio as gr
8
  import tensorflow_text as text # Registers the ops. (needed for "bert_preprocessor")
9
+ from hub.tensorflow_hub.hf_utils import pull_from_hub
10
  from sklearn.metrics.pairwise import cosine_similarity
11
 
12
  model = pull_from_hub(repo_id="Dimitre/universal-sentence-encoder")
requirements.txt CHANGED
@@ -1,4 +1,3 @@
1
  sklearn
2
  GitPython
3
- tensorflow
4
  tensorflow_text
 
1
  sklearn
2
  GitPython
 
3
  tensorflow_text