Spaces:
Sleeping
Sleeping
Add vertical scrolling
Browse files- Dockerfile +11 -21
- app.py +2 -1
Dockerfile
CHANGED
@@ -1,28 +1,18 @@
|
|
1 |
-
FROM python:3.
|
|
|
2 |
|
3 |
# Set up a new user named "user" with user ID 1000
|
4 |
RUN useradd -m -u 1000 user
|
|
|
|
|
5 |
|
6 |
-
|
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/app
|
15 |
-
|
16 |
-
# Try and run pip command after setting the user with `USER user` to avoid permission issues with Python
|
17 |
-
RUN pip install --no-cache-dir --upgrade pip
|
18 |
|
19 |
-
|
20 |
-
|
21 |
|
22 |
-
COPY --chown=user
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
COPY --chown=user app.py .
|
27 |
|
28 |
-
|
|
|
1 |
+
FROM python:3.12
|
2 |
+
COPY --from=ghcr.io/astral-sh/uv:0.4.20 /uv /bin/uv
|
3 |
|
4 |
# Set up a new user named "user" with user ID 1000
|
5 |
RUN useradd -m -u 1000 user
|
6 |
+
ENV PATH="/home/user/.local/bin:$PATH"
|
7 |
+
ENV UV_SYSTEM_PYTHON=1
|
8 |
|
9 |
+
WORKDIR /app
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
|
11 |
+
COPY --chown=user ./requirements.txt requirements.txt
|
12 |
+
RUN uv pip install -r requirements.txt
|
13 |
|
14 |
+
COPY --chown=user . /app
|
15 |
+
# Switch to the "user" user
|
16 |
+
USER user
|
|
|
|
|
17 |
|
18 |
+
CMD ["solara", "run", "app.py", "--host", "0.0.0.0", "--port", "7860"]
|
app.py
CHANGED
@@ -286,7 +286,8 @@ def Page():
|
|
286 |
|
287 |
result = solara.lab.use_task(result, dependencies=[user_message_count]) # type: ignore
|
288 |
|
289 |
-
with ChatBox(style={"background-color":"transparent!important","flex-grow":"1","position": "fixed", "bottom": "10rem", "width": "50%"}):
|
|
|
290 |
for item in messages.value:
|
291 |
with ChatMessage(
|
292 |
user=item["role"] == "user",
|
|
|
286 |
|
287 |
result = solara.lab.use_task(result, dependencies=[user_message_count]) # type: ignore
|
288 |
|
289 |
+
#with ChatBox(style={"background-color":"transparent!important","flex-grow":"1","position": "fixed", "bottom": "10rem", "width": "50%"}):
|
290 |
+
with ChatBox(style={"position": "fixed", "overflow-y": "scroll","scrollbar-width": "none", "-ms-overflow-style": "none", "top": "4.5rem", "bottom": "10rem", "width": "50%"}):
|
291 |
for item in messages.value:
|
292 |
with ChatMessage(
|
293 |
user=item["role"] == "user",
|