Spaces:
Runtime error
Runtime error
camphong24032002
commited on
Commit
•
339198c
1
Parent(s):
0ef6b85
Test
Browse files- Dockerfile +0 -1
- app.py +3 -2
Dockerfile
CHANGED
@@ -19,7 +19,6 @@ ENV NKTL_DATA=/nltk_data
|
|
19 |
RUN [ "python", "-c", "import nltk; nltk.download('stopwords', download_dir='/usr/local/nltk_data')" ]
|
20 |
|
21 |
RUN chown -R 1000:1000 /code
|
22 |
-
RUN chown -R 1000:1000 /.cache
|
23 |
|
24 |
|
25 |
USER 1000
|
|
|
19 |
RUN [ "python", "-c", "import nltk; nltk.download('stopwords', download_dir='/usr/local/nltk_data')" ]
|
20 |
|
21 |
RUN chown -R 1000:1000 /code
|
|
|
22 |
|
23 |
|
24 |
USER 1000
|
app.py
CHANGED
@@ -2,6 +2,7 @@ import pandas as pd
|
|
2 |
from sentence_transformers import SentenceTransformer, util
|
3 |
from flask import Flask, render_template, request, jsonify
|
4 |
from nltk.corpus import stopwords
|
|
|
5 |
stop = stopwords.words('english')
|
6 |
|
7 |
|
@@ -34,9 +35,9 @@ def df_to_text(df):
|
|
34 |
df = pd.read_csv("data/dataset.csv").reset_index(drop=True)
|
35 |
embedding_df = pd.read_csv("data/embedding.csv", header=None)
|
36 |
docs = embedding_df.values
|
37 |
-
|
38 |
|
39 |
-
model = SentenceTransformer("bert-base-nli-mean-tokens")
|
40 |
|
41 |
|
42 |
app = Flask(__name__)
|
|
|
2 |
from sentence_transformers import SentenceTransformer, util
|
3 |
from flask import Flask, render_template, request, jsonify
|
4 |
from nltk.corpus import stopwords
|
5 |
+
import os
|
6 |
stop = stopwords.words('english')
|
7 |
|
8 |
|
|
|
35 |
df = pd.read_csv("data/dataset.csv").reset_index(drop=True)
|
36 |
embedding_df = pd.read_csv("data/embedding.csv", header=None)
|
37 |
docs = embedding_df.values
|
38 |
+
HF_TOKEN=os.environ("HF_TOKEN")
|
39 |
|
40 |
+
model = SentenceTransformer("bert-base-nli-mean-tokens", cache_folder = "/code/", use_auth_token=HF_TOKEN)
|
41 |
|
42 |
|
43 |
app = Flask(__name__)
|