Spaces:
Runtime error
Runtime error
Commit ·
ef003ce
1
Parent(s): cdb7e02
fix perms
Browse files- Dockerfile +5 -3
- static/script.js +1 -1
Dockerfile
CHANGED
|
@@ -5,17 +5,19 @@ FROM python:3.9
|
|
| 5 |
|
| 6 |
WORKDIR /code
|
| 7 |
|
| 8 |
-
COPY ./requirements.txt /code/requirements.txt
|
| 9 |
RUN useradd -m -u 1000 user
|
| 10 |
USER user
|
|
|
|
| 11 |
ENV HOME=/home/user \
|
| 12 |
PATH=/home/user/.local/bin:$PATH
|
| 13 |
|
|
|
|
|
|
|
| 14 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
| 15 |
|
| 16 |
-
COPY . .
|
| 17 |
RUN python -c "from cltk.data.fetch import FetchCorpus; corpus_downloader = FetchCorpus(language='lat');corpus_downloader.import_corpus('lat_models_cltk')"
|
| 18 |
|
| 19 |
-
RUN chmod
|
| 20 |
|
| 21 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 5 |
|
| 6 |
WORKDIR /code
|
| 7 |
|
|
|
|
| 8 |
RUN useradd -m -u 1000 user
|
| 9 |
USER user
|
| 10 |
+
|
| 11 |
ENV HOME=/home/user \
|
| 12 |
PATH=/home/user/.local/bin:$PATH
|
| 13 |
|
| 14 |
+
COPY --chown=user ./requirements.txt /code/requirements.txt
|
| 15 |
+
|
| 16 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
| 17 |
|
| 18 |
+
COPY --chown=user . .
|
| 19 |
RUN python -c "from cltk.data.fetch import FetchCorpus; corpus_downloader = FetchCorpus(language='lat');corpus_downloader.import_corpus('lat_models_cltk')"
|
| 20 |
|
| 21 |
+
RUN chmod +x bin/words
|
| 22 |
|
| 23 |
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
|
static/script.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
const textGenForm = document.querySelector(".text-gen-form");
|
| 2 |
|
| 3 |
const translateText = async (text) => {
|
| 4 |
-
const inferResponse = await fetch(`process?
|
| 5 |
const inferJson = await inferResponse.json();
|
| 6 |
|
| 7 |
return inferJson;
|
|
|
|
| 1 |
const textGenForm = document.querySelector(".text-gen-form");
|
| 2 |
|
| 3 |
const translateText = async (text) => {
|
| 4 |
+
const inferResponse = await fetch(`process?text=${text}`);
|
| 5 |
const inferJson = await inferResponse.json();
|
| 6 |
|
| 7 |
return inferJson;
|