Spaces:
Running
Running
updates
Browse files- Dockerfile +1 -0
- webchat.py +1 -3
Dockerfile
CHANGED
@@ -20,6 +20,7 @@ RUN mkdir -p /app/.cache && \
|
|
20 |
chmod -R 777 /app && \
|
21 |
chmod -R 777 /app/.cache
|
22 |
ENV TRANSFORMERS_CACHE=/app/.cache
|
|
|
23 |
# Copy the rest of the application code
|
24 |
COPY app.py /app/app.py
|
25 |
COPY webchat.py /app/webchat.py
|
|
|
20 |
chmod -R 777 /app && \
|
21 |
chmod -R 777 /app/.cache
|
22 |
ENV TRANSFORMERS_CACHE=/app/.cache
|
23 |
+
ENV HF_HOME=/app/.cache
|
24 |
# Copy the rest of the application code
|
25 |
COPY app.py /app/app.py
|
26 |
COPY webchat.py /app/webchat.py
|
webchat.py
CHANGED
@@ -80,15 +80,13 @@ def get_model_test(model_type, max_tokens, min_tokens, decoding, temperature):
|
|
80 |
return model
|
81 |
|
82 |
# Download the model first
|
83 |
-
model = SentenceTransformer('all-MiniLM-L6-v2')
|
84 |
-
|
85 |
# Embedding function
|
86 |
class MiniLML6V2EmbeddingFunction(EmbeddingFunction):
|
87 |
MODEL = model
|
88 |
def __call__(self, texts):
|
89 |
return MiniLML6V2EmbeddingFunction.MODEL.encode(texts).tolist()
|
90 |
|
91 |
-
|
92 |
def extract_text(url):
|
93 |
try:
|
94 |
# Send an HTTP GET request to the URL
|
|
|
80 |
return model
|
81 |
|
82 |
# Download the model first
|
83 |
+
model = SentenceTransformer('sentence-transformers/all-MiniLM-L6-v2')
|
|
|
84 |
# Embedding function
|
85 |
class MiniLML6V2EmbeddingFunction(EmbeddingFunction):
|
86 |
MODEL = model
|
87 |
def __call__(self, texts):
|
88 |
return MiniLML6V2EmbeddingFunction.MODEL.encode(texts).tolist()
|
89 |
|
|
|
90 |
def extract_text(url):
|
91 |
try:
|
92 |
# Send an HTTP GET request to the URL
|