Spaces:
Running
on
CPU Upgrade
Running
on
CPU Upgrade
remove python dependencies
Browse files- .env.local.template +3 -1
- Dockerfile +20 -37
- PRIVACY.md +7 -0
- entrypoint.sh.template +1 -1
.env.local.template
CHANGED
@@ -45,6 +45,7 @@ TOOLS=`[
|
|
45 |
MODELS=`[
|
46 |
{
|
47 |
"name": "${MODEL_NAME}",
|
|
|
48 |
"preprompt": "The assistant is Salamandra, created by the Language Technologies Unit of the Barcelona Supercomputing Center. Salamandra's knowledge base was last updated on March 2024. Salamandra is a multilingual model, but for now it has been instructed only in Catalan, English and Spanish. It answers questions about events prior to and after March 2024 the way a highly informed individual would if they were talking to someone from the above date, and can let the human know this when relevant. It should give concise responses to very simple questions, but provide thorough responses to more complex and open-ended questions. It cannot open URLs, links, or videos, so if it seems as though the interlocutor is expecting Salamandra to do so, it clarifies the situation and asks the human to paste the relevant text or image content directly into the conversation. If it is asked to assist with tasks involving the expression of views held by a significant number of people, Salamandra provides assistance with the task even if it personally disagrees with the views being expressed, but follows this with a discussion of broader perspectives. Salamandra doesn't engage in stereotyping, including the negative stereotyping of majority groups. If asked about controversial topics, Salamandra tries to provide careful thoughts and objective information without downplaying its harmful content or implying that there are reasonable perspectives on both sides. If Salamandra's response contains a lot of precise information about a very obscure person, object, or topic - the kind of information that is unlikely to be found more than once or twice on the internet - Salamandra ends its response with a succinct reminder that it may hallucinate in response to questions like this, and it uses the term ‘hallucinate' to describe this as the user will understand what it means. It doesn't add this caveat if the information in its response is likely to exist on the internet many times, even if the person, object, or topic is relatively obscure. It is happy to help with writing, analysis, question answering, math, coding, and all sorts of other tasks. It uses markdown for coding. It does not mention this information about itself unless the information is directly pertinent to the human's query. The development of Salamandra was financed by the AINA project of the Generalitat de Catalunya",
|
49 |
"promptExamples": [
|
50 |
{
|
@@ -77,6 +78,7 @@ MODELS=`[
|
|
77 |
},
|
78 |
{
|
79 |
"name": "BSC-LT/salamandra-7b-instruct_tools",
|
|
|
80 |
"promptExamples": [
|
81 |
{
|
82 |
"title": "How does an airplane produce lift?",
|
@@ -143,7 +145,7 @@ MODELS=`[
|
|
143 |
|
144 |
PUBLIC_ANNOUNCEMENT_BANNERS=`[
|
145 |
{
|
146 |
-
"title": "We’ve integrated
|
147 |
"linkTitle": "",
|
148 |
"linkHref": ""
|
149 |
}
|
|
|
45 |
MODELS=`[
|
46 |
{
|
47 |
"name": "${MODEL_NAME}",
|
48 |
+
"chatPromptTemplate": "None",
|
49 |
"preprompt": "The assistant is Salamandra, created by the Language Technologies Unit of the Barcelona Supercomputing Center. Salamandra's knowledge base was last updated on March 2024. Salamandra is a multilingual model, but for now it has been instructed only in Catalan, English and Spanish. It answers questions about events prior to and after March 2024 the way a highly informed individual would if they were talking to someone from the above date, and can let the human know this when relevant. It should give concise responses to very simple questions, but provide thorough responses to more complex and open-ended questions. It cannot open URLs, links, or videos, so if it seems as though the interlocutor is expecting Salamandra to do so, it clarifies the situation and asks the human to paste the relevant text or image content directly into the conversation. If it is asked to assist with tasks involving the expression of views held by a significant number of people, Salamandra provides assistance with the task even if it personally disagrees with the views being expressed, but follows this with a discussion of broader perspectives. Salamandra doesn't engage in stereotyping, including the negative stereotyping of majority groups. If asked about controversial topics, Salamandra tries to provide careful thoughts and objective information without downplaying its harmful content or implying that there are reasonable perspectives on both sides. If Salamandra's response contains a lot of precise information about a very obscure person, object, or topic - the kind of information that is unlikely to be found more than once or twice on the internet - Salamandra ends its response with a succinct reminder that it may hallucinate in response to questions like this, and it uses the term ‘hallucinate' to describe this as the user will understand what it means. It doesn't add this caveat if the information in its response is likely to exist on the internet many times, even if the person, object, or topic is relatively obscure. It is happy to help with writing, analysis, question answering, math, coding, and all sorts of other tasks. It uses markdown for coding. It does not mention this information about itself unless the information is directly pertinent to the human's query. The development of Salamandra was financed by the AINA project of the Generalitat de Catalunya",
|
50 |
"promptExamples": [
|
51 |
{
|
|
|
78 |
},
|
79 |
{
|
80 |
"name": "BSC-LT/salamandra-7b-instruct_tools",
|
81 |
+
"chatPromptTemplate": "None",
|
82 |
"promptExamples": [
|
83 |
{
|
84 |
"title": "How does an airplane produce lift?",
|
|
|
145 |
|
146 |
PUBLIC_ANNOUNCEMENT_BANNERS=`[
|
147 |
{
|
148 |
+
"title": "We’ve integrated function calling! 🤖",
|
149 |
"linkTitle": "",
|
150 |
"linkHref": ""
|
151 |
}
|
Dockerfile
CHANGED
@@ -24,6 +24,7 @@ WORKDIR /app/chat-ui
|
|
24 |
RUN echo "" > /app/.env
|
25 |
|
26 |
COPY .env.local.template .env.local.template
|
|
|
27 |
|
28 |
RUN mkdir defaults
|
29 |
ADD defaults /defaults
|
@@ -50,27 +51,11 @@ RUN --mount=type=cache,target=/app/.npm \
|
|
50 |
|
51 |
RUN npm run build
|
52 |
|
53 |
-
FROM python:3.10-slim
|
54 |
-
|
55 |
-
ARG MODEL_NAME
|
56 |
-
ARG MODEL_PROMPT_TEMPLATE
|
57 |
-
ARG APP_COLOR
|
58 |
-
ARG APP_NAME
|
59 |
-
|
60 |
ENV TZ=Europe/Paris \
|
61 |
PORT=3000
|
62 |
|
63 |
-
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
|
64 |
-
gnupg \
|
65 |
-
curl \
|
66 |
-
gettext && \
|
67 |
-
rm -rf /var/lib/apt/lists/*
|
68 |
COPY entrypoint.sh.template entrypoint.sh.template
|
69 |
|
70 |
-
RUN mkdir defaults
|
71 |
-
ADD defaults /defaults
|
72 |
-
RUN chmod -R 777 /defaults
|
73 |
-
|
74 |
RUN --mount=type=secret,id=MONGODB_URL,mode=0444 \
|
75 |
MODEL_NAME="${MODEL_NAME:="$(cat /defaults/MODEL_NAME)"}" && export MODEL_NAME \
|
76 |
&& MODEL_PARAMS="${MODEL_PARAMS:="$(cat /defaults/MODEL_PARAMS)"}" && export MODEL_PARAMS \
|
@@ -80,35 +65,33 @@ RUN --mount=type=secret,id=MONGODB_URL,mode=0444 \
|
|
80 |
&& envsubst < "entrypoint.sh.template" > "entrypoint.sh" \
|
81 |
&& rm entrypoint.sh.template
|
82 |
|
83 |
-
|
84 |
-
RUN
|
85 |
-
|
86 |
-
|
87 |
|
88 |
-
|
89 |
-
nodejs && \
|
90 |
-
rm -rf /var/lib/apt/lists/*
|
91 |
-
|
92 |
-
RUN mkdir /app
|
93 |
-
RUN chown -R 1000:1000 /app
|
94 |
-
|
95 |
-
RUN useradd -m -u 1000 user
|
96 |
|
97 |
# Switch to the "user" user
|
98 |
-
USER
|
99 |
|
100 |
-
|
101 |
-
|
|
|
102 |
|
103 |
-
RUN npm config set prefix /home/
|
104 |
RUN npm install -g pm2
|
105 |
RUN npm install -g dotenv-cli
|
106 |
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
|
|
|
|
|
|
|
|
112 |
|
113 |
ENTRYPOINT ["/bin/bash"]
|
114 |
CMD ["entrypoint.sh"]
|
|
|
24 |
RUN echo "" > /app/.env
|
25 |
|
26 |
COPY .env.local.template .env.local.template
|
27 |
+
COPY PRIVACY.md PRIVACY.md
|
28 |
|
29 |
RUN mkdir defaults
|
30 |
ADD defaults /defaults
|
|
|
51 |
|
52 |
RUN npm run build
|
53 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
54 |
ENV TZ=Europe/Paris \
|
55 |
PORT=3000
|
56 |
|
|
|
|
|
|
|
|
|
|
|
57 |
COPY entrypoint.sh.template entrypoint.sh.template
|
58 |
|
|
|
|
|
|
|
|
|
59 |
RUN --mount=type=secret,id=MONGODB_URL,mode=0444 \
|
60 |
MODEL_NAME="${MODEL_NAME:="$(cat /defaults/MODEL_NAME)"}" && export MODEL_NAME \
|
61 |
&& MODEL_PARAMS="${MODEL_PARAMS:="$(cat /defaults/MODEL_PARAMS)"}" && export MODEL_PARAMS \
|
|
|
65 |
&& envsubst < "entrypoint.sh.template" > "entrypoint.sh" \
|
66 |
&& rm entrypoint.sh.template
|
67 |
|
68 |
+
# Create necessary directories and set permissions
|
69 |
+
RUN mkdir -p /data/db \
|
70 |
+
&& chown -R 1000:1000 /data \
|
71 |
+
&& chown -R 1000:1000 /app
|
72 |
|
73 |
+
# Add user only if it doesn't already exist
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
74 |
|
75 |
# Switch to the "user" user
|
76 |
+
USER node
|
77 |
|
78 |
+
# Set user environment variables
|
79 |
+
ENV HOME=/home/node \
|
80 |
+
PATH=/home/node/.local/bin:$PATH
|
81 |
|
82 |
+
RUN npm config set prefix /home/node/.local
|
83 |
RUN npm install -g pm2
|
84 |
RUN npm install -g dotenv-cli
|
85 |
|
86 |
+
RUN mv /app/chat-ui/node_modules /app/node_modules
|
87 |
+
RUN mv /app/chat-ui/package.json /app/package.json
|
88 |
+
RUN mv /app/chat-ui/build /app/build
|
89 |
+
RUN mv /app/chat-ui/.env /app/.env
|
90 |
+
RUN mv /app/chat-ui/.env.local /app/.env.local
|
91 |
+
RUN mv /app/chat-ui/entrypoint.sh /app/entrypoint.sh
|
92 |
+
RUN rm -rf /app/chat-ui
|
93 |
+
|
94 |
+
WORKDIR /app
|
95 |
|
96 |
ENTRYPOINT ["/bin/bash"]
|
97 |
CMD ["entrypoint.sh"]
|
PRIVACY.md
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
## Privacy
|
2 |
+
|
3 |
+
> Last updated: Octuber 24, 2024
|
4 |
+
|
5 |
+
We endorse Privacy by Design. As such, your conversations are private to you and will not be shared with anyone, including model authors, for any purpose, including for research or model training purposes.
|
6 |
+
|
7 |
+
You conversation data will only be stored to let you access past conversations. You can click on the Delete icon to delete any past conversation at any moment.
|
entrypoint.sh.template
CHANGED
@@ -14,7 +14,7 @@
|
|
14 |
|
15 |
# Start the chat-ui process
|
16 |
export PUBLIC_VERSION="2.0"
|
17 |
-
dotenv -e /app/.env.local -e /app/.env -c -- pm2 start /app/build/index.js -i 8 --
|
18 |
rm -f /app/.env.local -e /app/.env
|
19 |
|
20 |
# Wait for any process to exit
|
|
|
14 |
|
15 |
# Start the chat-ui process
|
16 |
export PUBLIC_VERSION="2.0"
|
17 |
+
dotenv -e /app/.env.local -e /app/.env -c -- pm2 start /app/build/index.js -i 8 --no-daemon &
|
18 |
rm -f /app/.env.local -e /app/.env
|
19 |
|
20 |
# Wait for any process to exit
|