Spaces:
Runtime error
Runtime error
willsh1997
commited on
Commit
·
8db04a1
1
Parent(s):
5d69fbf
:wrench: changed cache env directory
Browse files- flask-test/Dockerfile +2 -0
- flask-test/reranker.py +4 -0
- temp +0 -0
flask-test/Dockerfile
CHANGED
@@ -8,4 +8,6 @@ RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
|
8 |
|
9 |
COPY . .
|
10 |
|
|
|
|
|
11 |
CMD ["gunicorn", "-b", "0.0.0.0:7860", "my_web_app:app"]
|
|
|
8 |
|
9 |
COPY . .
|
10 |
|
11 |
+
CMD ["mkdir", "./.cache"]
|
12 |
+
|
13 |
CMD ["gunicorn", "-b", "0.0.0.0:7860", "my_web_app:app"]
|
flask-test/reranker.py
CHANGED
@@ -9,10 +9,14 @@ from copy import deepcopy
|
|
9 |
#sample data
|
10 |
from sample_data import BASIC_EXAMPLE
|
11 |
|
|
|
|
|
|
|
12 |
#load model
|
13 |
encodingModel = SentenceTransformer('sentence-transformers/all-mpnet-base-v2')
|
14 |
|
15 |
#create embeddings from example texts
|
|
|
16 |
|
17 |
#left wing
|
18 |
with open('/mnt/c/Users/hew7/Documents/Git/ChaiProsocialRankingChallenge/flask-test/manifesto-left.txt', 'r') as f:
|
|
|
9 |
#sample data
|
10 |
from sample_data import BASIC_EXAMPLE
|
11 |
|
12 |
+
#environment setup for HF docker image
|
13 |
+
|
14 |
+
|
15 |
#load model
|
16 |
encodingModel = SentenceTransformer('sentence-transformers/all-mpnet-base-v2')
|
17 |
|
18 |
#create embeddings from example texts
|
19 |
+
os.environ['SENTENCE_TRANSFORMERS_HOME'] = './.cache'
|
20 |
|
21 |
#left wing
|
22 |
with open('/mnt/c/Users/hew7/Documents/Git/ChaiProsocialRankingChallenge/flask-test/manifesto-left.txt', 'r') as f:
|
temp
DELETED
File without changes
|