AdamNovotnyCom
commited on
Commit
•
338822e
1
Parent(s):
84054b0
refactor
Browse files- Dockerfile +4 -2
- app.py +2 -0
Dockerfile
CHANGED
@@ -6,6 +6,10 @@ RUN useradd -m -u 1000 user
|
|
6 |
# Switch to the "user" user
|
7 |
USER user
|
8 |
|
|
|
|
|
|
|
|
|
9 |
# Set the working directory to the user's home directory
|
10 |
WORKDIR /home/user/app
|
11 |
|
@@ -14,8 +18,6 @@ COPY --chown=user . /home/user/app
|
|
14 |
|
15 |
RUN pip install -r requirements.txt
|
16 |
|
17 |
-
ENV HF_TOKEN $HF_TOKEN
|
18 |
-
|
19 |
EXPOSE 7860
|
20 |
|
21 |
CMD ["python", "app.py"]
|
|
|
6 |
# Switch to the "user" user
|
7 |
USER user
|
8 |
|
9 |
+
# Set home to the user's home directory
|
10 |
+
ENV HOME=/home/user \
|
11 |
+
PATH=/home/user/.local/bin:$PATH
|
12 |
+
|
13 |
# Set the working directory to the user's home directory
|
14 |
WORKDIR /home/user/app
|
15 |
|
|
|
18 |
|
19 |
RUN pip install -r requirements.txt
|
20 |
|
|
|
|
|
21 |
EXPOSE 7860
|
22 |
|
23 |
CMD ["python", "app.py"]
|
app.py
CHANGED
@@ -10,6 +10,8 @@ logging.info(os.environ["HF_TOKEN"][:5])
|
|
10 |
|
11 |
pipe_flan = transformers.pipeline("text2text-generation", model="google/flan-t5-small")
|
12 |
def google_flan(input_text):
|
|
|
|
|
13 |
return pipe_flan(input_text)
|
14 |
|
15 |
demo = gr.Interface(fn=google_flan, inputs="text", outputs="text")
|
|
|
10 |
|
11 |
pipe_flan = transformers.pipeline("text2text-generation", model="google/flan-t5-small")
|
12 |
def google_flan(input_text):
|
13 |
+
print("New response")
|
14 |
+
logging.info("New response")
|
15 |
return pipe_flan(input_text)
|
16 |
|
17 |
demo = gr.Interface(fn=google_flan, inputs="text", outputs="text")
|