Spaces:
Sleeping
Sleeping
upddate
Browse files- Dockerfile +36 -5
- entrypoint.sh +0 -1
- server/__pycache__/backend.cpython-310.pyc +0 -0
- server/__pycache__/config.cpython-310.pyc +0 -0
- server/backend.py +2 -2
- translations/ar_SA/LC_MESSAGES/messages.mo +0 -0
- translations/cs_CZ/LC_MESSAGES/messages.mo +0 -0
- translations/da_DK/LC_MESSAGES/messages.mo +0 -0
- translations/de_DE/LC_MESSAGES/messages.mo +0 -0
- translations/el_GR/LC_MESSAGES/messages.mo +0 -0
- translations/en_US/LC_MESSAGES/messages.mo +0 -0
- translations/es_ES/LC_MESSAGES/messages.mo +0 -0
- translations/es_MX/LC_MESSAGES/messages.mo +0 -0
- translations/fi_FI/LC_MESSAGES/messages.mo +0 -0
- translations/fr_FR/LC_MESSAGES/messages.mo +0 -0
- translations/he_IL/LC_MESSAGES/messages.mo +0 -0
- translations/hi_IN/LC_MESSAGES/messages.mo +0 -0
- translations/hu_HU/LC_MESSAGES/messages.mo +0 -0
- translations/id_ID/LC_MESSAGES/messages.mo +0 -0
- translations/it_IT/LC_MESSAGES/messages.mo +0 -0
- translations/ja_JP/LC_MESSAGES/messages.mo +0 -0
- translations/ko_KR/LC_MESSAGES/messages.mo +0 -0
- translations/nb_NO/LC_MESSAGES/messages.mo +0 -0
- translations/nl_NL/LC_MESSAGES/messages.mo +0 -0
- translations/pl_PL/LC_MESSAGES/messages.mo +0 -0
- translations/pt_BR/LC_MESSAGES/messages.mo +0 -0
- translations/ro_RO/LC_MESSAGES/messages.mo +0 -0
- translations/ru_RU/LC_MESSAGES/messages.mo +0 -0
- translations/sk_SK/LC_MESSAGES/messages.mo +0 -0
- translations/sv_SE/LC_MESSAGES/messages.mo +0 -0
- translations/th_TH/LC_MESSAGES/messages.mo +0 -0
- translations/tr_TR/LC_MESSAGES/messages.mo +0 -0
- translations/uk_UA/LC_MESSAGES/messages.mo +0 -0
- translations/vi_VN/LC_MESSAGES/messages.mo +0 -0
- translations/zh_Hans_CN/LC_MESSAGES/messages.mo +0 -0
- translations/zh_Hant_TW/LC_MESSAGES/messages.mo +0 -0
Dockerfile
CHANGED
@@ -1,12 +1,17 @@
|
|
1 |
FROM python:3.10-slim-buster
|
|
|
2 |
# Set the working directory
|
3 |
WORKDIR /app
|
|
|
4 |
# Copy requirements file
|
5 |
COPY requirements.txt requirements.txt
|
|
|
6 |
# Create a virtual environment
|
7 |
RUN python -m venv venv
|
|
|
8 |
# Set the PATH to use the virtual environment
|
9 |
ENV PATH="/app/venv/bin:$PATH"
|
|
|
10 |
# Update package list and install necessary packages in a single step
|
11 |
RUN apt-get update && apt-get install -y \
|
12 |
curl \
|
@@ -17,19 +22,45 @@ RUN apt-get update && apt-get install -y \
|
|
17 |
tini \
|
18 |
systemd && \
|
19 |
apt-get clean
|
|
|
20 |
# Upgrade pip and install dependencies
|
21 |
RUN python -m pip install --upgrade pip
|
22 |
RUN pip install --no-cache-dir -r requirements.txt
|
23 |
-
|
24 |
-
|
|
|
|
|
|
|
25 |
RUN mkdir -p /.ollama && chmod 777 /.ollama
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
RUN which ollama
|
27 |
-
|
28 |
-
|
29 |
# Copy the entire application
|
30 |
COPY . .
|
|
|
31 |
# Set proper permissions for the translations directory
|
32 |
RUN chmod -R 777 translations
|
|
|
|
|
|
|
|
|
|
|
33 |
# Define the command to run the application
|
34 |
CMD ["python", "./run.py"]
|
35 |
-
|
|
|
1 |
FROM python:3.10-slim-buster
|
2 |
+
|
3 |
# Set the working directory
|
4 |
WORKDIR /app
|
5 |
+
|
6 |
# Copy requirements file
|
7 |
COPY requirements.txt requirements.txt
|
8 |
+
|
9 |
# Create a virtual environment
|
10 |
RUN python -m venv venv
|
11 |
+
|
12 |
# Set the PATH to use the virtual environment
|
13 |
ENV PATH="/app/venv/bin:$PATH"
|
14 |
+
|
15 |
# Update package list and install necessary packages in a single step
|
16 |
RUN apt-get update && apt-get install -y \
|
17 |
curl \
|
|
|
22 |
tini \
|
23 |
systemd && \
|
24 |
apt-get clean
|
25 |
+
|
26 |
# Upgrade pip and install dependencies
|
27 |
RUN python -m pip install --upgrade pip
|
28 |
RUN pip install --no-cache-dir -r requirements.txt
|
29 |
+
|
30 |
+
# Install application
|
31 |
+
RUN curl https://ollama.ai/install.sh | sh
|
32 |
+
|
33 |
+
# Create the directory and give appropriate permissions
|
34 |
RUN mkdir -p /.ollama && chmod 777 /.ollama
|
35 |
+
|
36 |
+
WORKDIR /.ollama
|
37 |
+
# Copy the entry point script
|
38 |
+
COPY entrypoint.sh /entrypoint.sh
|
39 |
+
RUN chmod +x /entrypoint.sh
|
40 |
+
# Set the entry point script as the default command
|
41 |
+
ENTRYPOINT ["/entrypoint.sh"]
|
42 |
+
|
43 |
+
CMD ["ollama", "serve"]
|
44 |
+
|
45 |
+
# Set the model as an environment variable (this can be overridden)
|
46 |
+
ENV model=${model}
|
47 |
+
|
48 |
+
# Expose the server port
|
49 |
+
EXPOSE 7860
|
50 |
+
|
51 |
+
# Ensure Ollama binary is in the PATH
|
52 |
RUN which ollama
|
53 |
+
|
54 |
+
|
55 |
# Copy the entire application
|
56 |
COPY . .
|
57 |
+
|
58 |
# Set proper permissions for the translations directory
|
59 |
RUN chmod -R 777 translations
|
60 |
+
|
61 |
+
# Copy the startup script and make it executable
|
62 |
+
COPY start.sh .
|
63 |
+
RUN chmod +x start.sh
|
64 |
+
|
65 |
# Define the command to run the application
|
66 |
CMD ["python", "./run.py"]
|
|
entrypoint.sh
CHANGED
@@ -14,7 +14,6 @@ for m in "${MODELS[@]}"; do
|
|
14 |
# echo "Running $m"
|
15 |
# ollama run "$m"
|
16 |
# No need to sleep here unless you want to give some delay between each pull for some reason
|
17 |
-
python run.py
|
18 |
done
|
19 |
|
20 |
# Keep the script running to prevent the container from exiting
|
|
|
14 |
# echo "Running $m"
|
15 |
# ollama run "$m"
|
16 |
# No need to sleep here unless you want to give some delay between each pull for some reason
|
|
|
17 |
done
|
18 |
|
19 |
# Keep the script running to prevent the container from exiting
|
server/__pycache__/backend.cpython-310.pyc
CHANGED
Binary files a/server/__pycache__/backend.cpython-310.pyc and b/server/__pycache__/backend.cpython-310.pyc differ
|
|
server/__pycache__/config.cpython-310.pyc
CHANGED
Binary files a/server/__pycache__/config.cpython-310.pyc and b/server/__pycache__/config.cpython-310.pyc differ
|
|
server/backend.py
CHANGED
@@ -62,8 +62,8 @@ class Backend_Api:
|
|
62 |
model = request.json['model']
|
63 |
|
64 |
messages = build_messages(jailbreak)
|
65 |
-
local_mode_1=
|
66 |
-
local_model_2 =
|
67 |
print(model)
|
68 |
|
69 |
if model=='terminal':
|
|
|
62 |
model = request.json['model']
|
63 |
|
64 |
messages = build_messages(jailbreak)
|
65 |
+
local_mode_1=True
|
66 |
+
local_model_2 =False
|
67 |
print(model)
|
68 |
|
69 |
if model=='terminal':
|
translations/ar_SA/LC_MESSAGES/messages.mo
CHANGED
Binary files a/translations/ar_SA/LC_MESSAGES/messages.mo and b/translations/ar_SA/LC_MESSAGES/messages.mo differ
|
|
translations/cs_CZ/LC_MESSAGES/messages.mo
CHANGED
Binary files a/translations/cs_CZ/LC_MESSAGES/messages.mo and b/translations/cs_CZ/LC_MESSAGES/messages.mo differ
|
|
translations/da_DK/LC_MESSAGES/messages.mo
CHANGED
Binary files a/translations/da_DK/LC_MESSAGES/messages.mo and b/translations/da_DK/LC_MESSAGES/messages.mo differ
|
|
translations/de_DE/LC_MESSAGES/messages.mo
CHANGED
Binary files a/translations/de_DE/LC_MESSAGES/messages.mo and b/translations/de_DE/LC_MESSAGES/messages.mo differ
|
|
translations/el_GR/LC_MESSAGES/messages.mo
CHANGED
Binary files a/translations/el_GR/LC_MESSAGES/messages.mo and b/translations/el_GR/LC_MESSAGES/messages.mo differ
|
|
translations/en_US/LC_MESSAGES/messages.mo
CHANGED
Binary files a/translations/en_US/LC_MESSAGES/messages.mo and b/translations/en_US/LC_MESSAGES/messages.mo differ
|
|
translations/es_ES/LC_MESSAGES/messages.mo
CHANGED
Binary files a/translations/es_ES/LC_MESSAGES/messages.mo and b/translations/es_ES/LC_MESSAGES/messages.mo differ
|
|
translations/es_MX/LC_MESSAGES/messages.mo
CHANGED
Binary files a/translations/es_MX/LC_MESSAGES/messages.mo and b/translations/es_MX/LC_MESSAGES/messages.mo differ
|
|
translations/fi_FI/LC_MESSAGES/messages.mo
CHANGED
Binary files a/translations/fi_FI/LC_MESSAGES/messages.mo and b/translations/fi_FI/LC_MESSAGES/messages.mo differ
|
|
translations/fr_FR/LC_MESSAGES/messages.mo
CHANGED
Binary files a/translations/fr_FR/LC_MESSAGES/messages.mo and b/translations/fr_FR/LC_MESSAGES/messages.mo differ
|
|
translations/he_IL/LC_MESSAGES/messages.mo
CHANGED
Binary files a/translations/he_IL/LC_MESSAGES/messages.mo and b/translations/he_IL/LC_MESSAGES/messages.mo differ
|
|
translations/hi_IN/LC_MESSAGES/messages.mo
CHANGED
Binary files a/translations/hi_IN/LC_MESSAGES/messages.mo and b/translations/hi_IN/LC_MESSAGES/messages.mo differ
|
|
translations/hu_HU/LC_MESSAGES/messages.mo
CHANGED
Binary files a/translations/hu_HU/LC_MESSAGES/messages.mo and b/translations/hu_HU/LC_MESSAGES/messages.mo differ
|
|
translations/id_ID/LC_MESSAGES/messages.mo
CHANGED
Binary files a/translations/id_ID/LC_MESSAGES/messages.mo and b/translations/id_ID/LC_MESSAGES/messages.mo differ
|
|
translations/it_IT/LC_MESSAGES/messages.mo
CHANGED
Binary files a/translations/it_IT/LC_MESSAGES/messages.mo and b/translations/it_IT/LC_MESSAGES/messages.mo differ
|
|
translations/ja_JP/LC_MESSAGES/messages.mo
CHANGED
Binary files a/translations/ja_JP/LC_MESSAGES/messages.mo and b/translations/ja_JP/LC_MESSAGES/messages.mo differ
|
|
translations/ko_KR/LC_MESSAGES/messages.mo
CHANGED
Binary files a/translations/ko_KR/LC_MESSAGES/messages.mo and b/translations/ko_KR/LC_MESSAGES/messages.mo differ
|
|
translations/nb_NO/LC_MESSAGES/messages.mo
CHANGED
Binary files a/translations/nb_NO/LC_MESSAGES/messages.mo and b/translations/nb_NO/LC_MESSAGES/messages.mo differ
|
|
translations/nl_NL/LC_MESSAGES/messages.mo
CHANGED
Binary files a/translations/nl_NL/LC_MESSAGES/messages.mo and b/translations/nl_NL/LC_MESSAGES/messages.mo differ
|
|
translations/pl_PL/LC_MESSAGES/messages.mo
CHANGED
Binary files a/translations/pl_PL/LC_MESSAGES/messages.mo and b/translations/pl_PL/LC_MESSAGES/messages.mo differ
|
|
translations/pt_BR/LC_MESSAGES/messages.mo
CHANGED
Binary files a/translations/pt_BR/LC_MESSAGES/messages.mo and b/translations/pt_BR/LC_MESSAGES/messages.mo differ
|
|
translations/ro_RO/LC_MESSAGES/messages.mo
CHANGED
Binary files a/translations/ro_RO/LC_MESSAGES/messages.mo and b/translations/ro_RO/LC_MESSAGES/messages.mo differ
|
|
translations/ru_RU/LC_MESSAGES/messages.mo
CHANGED
Binary files a/translations/ru_RU/LC_MESSAGES/messages.mo and b/translations/ru_RU/LC_MESSAGES/messages.mo differ
|
|
translations/sk_SK/LC_MESSAGES/messages.mo
CHANGED
Binary files a/translations/sk_SK/LC_MESSAGES/messages.mo and b/translations/sk_SK/LC_MESSAGES/messages.mo differ
|
|
translations/sv_SE/LC_MESSAGES/messages.mo
CHANGED
Binary files a/translations/sv_SE/LC_MESSAGES/messages.mo and b/translations/sv_SE/LC_MESSAGES/messages.mo differ
|
|
translations/th_TH/LC_MESSAGES/messages.mo
CHANGED
Binary files a/translations/th_TH/LC_MESSAGES/messages.mo and b/translations/th_TH/LC_MESSAGES/messages.mo differ
|
|
translations/tr_TR/LC_MESSAGES/messages.mo
CHANGED
Binary files a/translations/tr_TR/LC_MESSAGES/messages.mo and b/translations/tr_TR/LC_MESSAGES/messages.mo differ
|
|
translations/uk_UA/LC_MESSAGES/messages.mo
CHANGED
Binary files a/translations/uk_UA/LC_MESSAGES/messages.mo and b/translations/uk_UA/LC_MESSAGES/messages.mo differ
|
|
translations/vi_VN/LC_MESSAGES/messages.mo
CHANGED
Binary files a/translations/vi_VN/LC_MESSAGES/messages.mo and b/translations/vi_VN/LC_MESSAGES/messages.mo differ
|
|
translations/zh_Hans_CN/LC_MESSAGES/messages.mo
CHANGED
Binary files a/translations/zh_Hans_CN/LC_MESSAGES/messages.mo and b/translations/zh_Hans_CN/LC_MESSAGES/messages.mo differ
|
|
translations/zh_Hant_TW/LC_MESSAGES/messages.mo
CHANGED
Binary files a/translations/zh_Hant_TW/LC_MESSAGES/messages.mo and b/translations/zh_Hant_TW/LC_MESSAGES/messages.mo differ
|
|