Quintino Fernandes
commited on
Commit
·
fc4aec6
1
Parent(s):
a2682b3
Bug fixing
Browse files- Dockerfile +6 -1
- app_antiga.py +2 -2
- database/query.py +1 -1
Dockerfile
CHANGED
|
@@ -19,9 +19,14 @@ COPY --chown=user ./requirements.txt requirements.txt
|
|
| 19 |
RUN pip install --no-cache-dir --upgrade pip && \
|
| 20 |
pip install --no-cache-dir -r requirements.txt
|
| 21 |
|
| 22 |
-
#
|
| 23 |
RUN python -m spacy download pt_core_news_md
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
# Copy application code
|
| 26 |
COPY --chown=user . /app
|
| 27 |
|
|
|
|
| 19 |
RUN pip install --no-cache-dir --upgrade pip && \
|
| 20 |
pip install --no-cache-dir -r requirements.txt
|
| 21 |
|
| 22 |
+
# Pre-download Spacy model
|
| 23 |
RUN python -m spacy download pt_core_news_md
|
| 24 |
|
| 25 |
+
# Pre-download T5 models
|
| 26 |
+
RUN python -c "from transformers import T5Tokenizer, T5ForConditionalGeneration; \
|
| 27 |
+
T5Tokenizer.from_pretrained('unicamp-dl/ptt5-base-portuguese-vocab'); \
|
| 28 |
+
T5ForConditionalGeneration.from_pretrained('recogna-nlp/ptt5-base-summ')"
|
| 29 |
+
|
| 30 |
# Copy application code
|
| 31 |
COPY --chown=user . /app
|
| 32 |
|
app_antiga.py
CHANGED
|
@@ -29,8 +29,8 @@ app.add_middleware(
|
|
| 29 |
)
|
| 30 |
|
| 31 |
#Database connection setup
|
| 32 |
-
url = "
|
| 33 |
-
key = "
|
| 34 |
opts = ClientOptions().replace(schema="articles")
|
| 35 |
supabase = create_client(url, key, options=opts)
|
| 36 |
|
|
|
|
| 29 |
)
|
| 30 |
|
| 31 |
#Database connection setup
|
| 32 |
+
url = ""
|
| 33 |
+
key = ""
|
| 34 |
opts = ClientOptions().replace(schema="articles")
|
| 35 |
supabase = create_client(url, key, options=opts)
|
| 36 |
|
database/query.py
CHANGED
|
@@ -48,7 +48,7 @@ class DatabaseService:
|
|
| 48 |
)
|
| 49 |
|
| 50 |
# Format results with metadata
|
| 51 |
-
formatted_results = []
|
| 52 |
for article_id, distance in results:
|
| 53 |
metadata = self.articles.fetch(ids=[article_id])[0]["metadata"]
|
| 54 |
formatted_results.append({
|
|
|
|
| 48 |
)
|
| 49 |
|
| 50 |
# Format results with metadata
|
| 51 |
+
formatted_results = []
|
| 52 |
for article_id, distance in results:
|
| 53 |
metadata = self.articles.fetch(ids=[article_id])[0]["metadata"]
|
| 54 |
formatted_results.append({
|