norjala commited on
Commit
5cb128c
1 Parent(s): 59acd88

Updating Dockerfile and app.py to fix the session disconnected HF issue

Browse files
Files changed (2) hide show
  1. Dockerfile +6 -27
  2. app.py +1 -1
Dockerfile CHANGED
@@ -1,34 +1,13 @@
1
- FROM python:3.12
2
-
3
- # Create a non-root user
4
  RUN useradd -m -u 1000 user
5
-
6
- # Switch to the non-root user
7
  USER user
8
-
9
- # Set environment variables
10
  ENV HOME=/home/user \
11
- PATH=/home/user/.local/bin:$PATH
12
-
13
- # Set the working directory
14
  WORKDIR $HOME/app
15
-
16
- # Copy application files and install dependencies
17
  COPY --chown=user . $HOME/app
18
- COPY ./requirements.txt $HOME/app/requirements.txt
19
  RUN pip install --upgrade pip
20
  RUN pip install -r requirements.txt
21
- RUN pip list
22
-
23
- # Create the necessary directories and set permissions
24
- USER root
25
- RUN mkdir -p /home/user/app/data/vectorstore && \
26
- mkdir -p /home/user/app/.chainlit && \
27
- chown -R user:user /home/user/app/data /home/user/app/.chainlit && \
28
- chmod -R 777 /home/user/app/data /home/user/app/.chainlit
29
-
30
- # Switch back to the non-root user
31
- USER user
32
-
33
- # Start the application
34
- CMD ["chainlit", "run", "app.py", "--port", "7860"]
 
1
+ FROM python:3.9
 
 
2
  RUN useradd -m -u 1000 user
 
 
3
  USER user
 
 
4
  ENV HOME=/home/user \
5
+ PATH=/home/user/.local/bin:$PATH
 
 
6
  WORKDIR $HOME/app
 
 
7
  COPY --chown=user . $HOME/app
8
+ COPY ./requirements.txt ~/app/requirements.txt
9
  RUN pip install --upgrade pip
10
  RUN pip install -r requirements.txt
11
+ RUN mkdir -p $HOME/app/data/vectorstore && chown -R user:user $HOME/app/data
12
+ COPY . .
13
+ CMD ["chainlit", "run", "app.py", "--port", "7860"]
 
 
 
 
 
 
 
 
 
 
 
app.py CHANGED
@@ -97,7 +97,7 @@ async def start_chat():
97
  settings = {
98
  "model": "gpt-4o",
99
  "temperature": 0,
100
- "max_tokens": 500,
101
  "top_p": 1,
102
  "frequency_penalty": 0,
103
  "presence_penalty": 0,
 
97
  settings = {
98
  "model": "gpt-4o",
99
  "temperature": 0,
100
+ "max_tokens": 64,
101
  "top_p": 1,
102
  "frequency_penalty": 0,
103
  "presence_penalty": 0,