edit docker compose
This commit is contained in:
29
Dockerfile
Executable file
29
Dockerfile
Executable file
@@ -0,0 +1,29 @@
|
|||||||
|
# Базовый образ с Python 3.11.11
|
||||||
|
FROM python:3.11.11
|
||||||
|
|
||||||
|
# Установка метаданных
|
||||||
|
LABEL maintainer="your-email@example.com"
|
||||||
|
LABEL description="Docker image with Python 3.11.11 and required packages"
|
||||||
|
|
||||||
|
# Обновление системы и установка базовых зависимостей
|
||||||
|
RUN apt-get update && \
|
||||||
|
apt-get install -y --no-install-recommends \
|
||||||
|
git \
|
||||||
|
curl \
|
||||||
|
wget \
|
||||||
|
nano \
|
||||||
|
sudo \
|
||||||
|
apt-utils \
|
||||||
|
cmake \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Обновление pip и установка setuptools/wheel
|
||||||
|
RUN pip install --upgrade pip && \
|
||||||
|
pip install setuptools wheel
|
||||||
|
|
||||||
|
# Проверка версии Python и pip
|
||||||
|
RUN python --version && pip --version
|
||||||
|
|
||||||
|
# Очистка кэша
|
||||||
|
RUN apt-get clean && \
|
||||||
|
rm -rf /tmp/* /var/tmp/*
|
||||||
@@ -7,10 +7,6 @@ message_print() {
|
|||||||
echo
|
echo
|
||||||
}
|
}
|
||||||
|
|
||||||
message_print "install apt packages"
|
|
||||||
apt update
|
|
||||||
apt install -y pip git curl wget nano sudo apt-utils cmake
|
|
||||||
|
|
||||||
cd /
|
cd /
|
||||||
|
|
||||||
message_print "Changing to repository..."
|
message_print "Changing to repository..."
|
||||||
@@ -18,13 +14,16 @@ git clone https://github.com/DrHo1y/ezrknn-llm
|
|||||||
cd ezrknn-llm/
|
cd ezrknn-llm/
|
||||||
cp ./rkllm-runtime/runtime/Linux/librkllm_api/aarch64/* /usr/lib
|
cp ./rkllm-runtime/runtime/Linux/librkllm_api/aarch64/* /usr/lib
|
||||||
cp ./rkllm-runtime/runtime/Linux/librkllm_api/include/* /usr/local/include
|
cp ./rkllm-runtime/runtime/Linux/librkllm_api/include/* /usr/local/include
|
||||||
|
|
||||||
message_print "Compiling LLM runtime for Linux..."
|
message_print "Compiling LLM runtime for Linux..."
|
||||||
cd ./rkllm-runtime/examples/rkllm_api_demo/
|
cd ./rkllm-runtime/examples/rkllm_api_demo/
|
||||||
bash build-linux.sh
|
bash build-linux.sh
|
||||||
|
|
||||||
message_print "Moving rkllm to /usr/bin..."
|
message_print "Moving rkllm to /usr/bin..."
|
||||||
cp ./build/build_linux_aarch64_Release/llm_demo /usr/bin/rkllm
|
cp ./build/build_linux_aarch64_Release/llm_demo /usr/bin/rkllm
|
||||||
echo "* soft nofile 16384" >> /etc/security/limits.conf
|
echo "* soft nofile 16384" >> /etc/security/limits.conf
|
||||||
echo "* hard nofile 1048576" >> /etc/security/limits.conf
|
echo "* hard nofile 1048576" >> /etc/security/limits.conf
|
||||||
|
|
||||||
message_print "Increasing file limit for all users (needed for LLMs to run)..."
|
message_print "Increasing file limit for all users (needed for LLMs to run)..."
|
||||||
echo "root soft nofile 16384" >> /etc/security/limits.conf
|
echo "root soft nofile 16384" >> /etc/security/limits.conf
|
||||||
echo "root hard nofile 1048576" >> /etc/security/limits.conf
|
echo "root hard nofile 1048576" >> /etc/security/limits.conf
|
||||||
|
|||||||
@@ -25,7 +25,18 @@ model_configs = {
|
|||||||
"temperature": 0.2,
|
"temperature": 0.2,
|
||||||
"repeat_penalty": 1.00,
|
"repeat_penalty": 1.00,
|
||||||
"frequency_penalty": 0.2,
|
"frequency_penalty": 0.2,
|
||||||
"system_prompt": "You are Qwen, created by Alibaba Cloud. You are a helpful assistant."
|
"system_prompt": """
|
||||||
|
Ты — эксперт по программированию, и твоя задача — генерировать только рабочий код без каких-либо комментариев, объяснений или дополнительного текста. Вывод должен содержать исключительно код, который можно скопировать и использовать напрямую.
|
||||||
|
|
||||||
|
<описание задачи>
|
||||||
|
|
||||||
|
Пример:
|
||||||
|
Если требуется написать функцию на Python, которая суммирует два числа, то ответ должен быть таким:
|
||||||
|
```
|
||||||
|
def sum(a, b):
|
||||||
|
return a + b
|
||||||
|
```
|
||||||
|
"""
|
||||||
},
|
},
|
||||||
"models": {
|
"models": {
|
||||||
"Qwen2.5-Coder-3B-Instruct-w8w8": {"filename": "Qwen2.5-Coder-3B-Instruct-w8w8.rkllm"}
|
"Qwen2.5-Coder-3B-Instruct-w8w8": {"filename": "Qwen2.5-Coder-3B-Instruct-w8w8.rkllm"}
|
||||||
|
|||||||
@@ -1,8 +1,10 @@
|
|||||||
services:
|
services:
|
||||||
rkllm:
|
rkllm:
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile
|
||||||
platform: linux/arm64/v8
|
platform: linux/arm64/v8
|
||||||
container_name: rkllm
|
container_name: rkllm
|
||||||
image: python:3.11.11
|
|
||||||
restart: always
|
restart: always
|
||||||
privileged: true
|
privileged: true
|
||||||
volumes:
|
volumes:
|
||||||
|
|||||||
Reference in New Issue
Block a user