AnatoliiG commited on
Commit ·
3b802b2
1
Parent(s): 6b2cb7a
Update model
Browse files- Dockerfile +6 -4
- build/diskcache-5.6.3-py3-none-any.whl +0 -3
- build/jinja2-3.1.6-py3-none-any.whl +0 -3
- build/llama_cpp_python-0.3.16-cp310-cp310-linux_x86_64.whl +0 -3
- build/markupsafe-3.0.3-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl +0 -3
- build/numpy-2.2.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl +0 -3
- build/typing_extensions-4.15.0-py3-none-any.whl +0 -3
- requirements.txt +1 -0
- src/core/config.py +6 -4
- src/core/engine.py +1 -0
Dockerfile
CHANGED
|
@@ -1,6 +1,9 @@
|
|
| 1 |
FROM python:3.10-slim-bookworm
|
| 2 |
|
|
|
|
| 3 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
|
|
|
|
|
| 4 |
libopenblas0 \
|
| 5 |
libgomp1 \
|
| 6 |
&& rm -rf /var/lib/apt/lists/*
|
|
@@ -15,11 +18,10 @@ WORKDIR /app
|
|
| 15 |
|
| 16 |
RUN pip install --no-cache-dir --upgrade pip
|
| 17 |
|
| 18 |
-
COPY --chown=user build /app/build
|
| 19 |
-
|
| 20 |
-
RUN pip install --force-reinstall /app/build/llama_cpp_python-*.whl
|
| 21 |
-
|
| 22 |
COPY --chown=user requirements.txt .
|
|
|
|
|
|
|
|
|
|
| 23 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 24 |
|
| 25 |
COPY --chown=user . .
|
|
|
|
| 1 |
FROM python:3.10-slim-bookworm
|
| 2 |
|
| 3 |
+
# Добавляем build-essential и cmake для правильной сборки llama-cpp из исходников под CPU сервера
|
| 4 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 5 |
+
build-essential \
|
| 6 |
+
cmake \
|
| 7 |
libopenblas0 \
|
| 8 |
libgomp1 \
|
| 9 |
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
| 18 |
|
| 19 |
RUN pip install --no-cache-dir --upgrade pip
|
| 20 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 21 |
COPY --chown=user requirements.txt .
|
| 22 |
+
|
| 23 |
+
# Собираем llama-cpp-python с оптимизацией под процессор (OpenBLAS)
|
| 24 |
+
ENV CMAKE_ARGS="-DGGML_BLAS=ON -DGGML_BLAS_VENDOR=OpenBLAS"
|
| 25 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 26 |
|
| 27 |
COPY --chown=user . .
|
build/diskcache-5.6.3-py3-none-any.whl
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:5e31b2d5fbad117cc363ebaf6b689474db18a1f6438bc82358b024abd4c2ca19
|
| 3 |
-
size 45550
|
|
|
|
|
|
|
|
|
|
|
|
build/jinja2-3.1.6-py3-none-any.whl
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67
|
| 3 |
-
size 134899
|
|
|
|
|
|
|
|
|
|
|
|
build/llama_cpp_python-0.3.16-cp310-cp310-linux_x86_64.whl
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:834c8e7761ab3fe276930fa700e61e817ffc00d9bcc3ffba8d288ae01d5d7e45
|
| 3 |
-
size 4283874
|
|
|
|
|
|
|
|
|
|
|
|
build/markupsafe-3.0.3-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:f42d0984e947b8adf7dd6dde396e720934d12c506ce84eea8476409563607591
|
| 3 |
-
size 20681
|
|
|
|
|
|
|
|
|
|
|
|
build/numpy-2.2.6-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:fc7b73d02efb0e18c000e9ad8b83480dfcd5dfd11065997ed4c6747470ae8915
|
| 3 |
-
size 16801050
|
|
|
|
|
|
|
|
|
|
|
|
build/typing_extensions-4.15.0-py3-none-any.whl
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:f0fa19c6845758ab08074a0cfa8b7aecb71c999ca73d62883bc25cc018c4e548
|
| 3 |
-
size 44614
|
|
|
|
|
|
|
|
|
|
|
|
requirements.txt
CHANGED
|
@@ -6,3 +6,4 @@ gradio>=5.9.0
|
|
| 6 |
python-multipart
|
| 7 |
psutil
|
| 8 |
pydantic-settings
|
|
|
|
|
|
| 6 |
python-multipart
|
| 7 |
psutil
|
| 8 |
pydantic-settings
|
| 9 |
+
llama-cpp-python>=0.3.1
|
src/core/config.py
CHANGED
|
@@ -4,11 +4,13 @@ from pydantic_settings import BaseSettings
|
|
| 4 |
|
| 5 |
|
| 6 |
class Settings(BaseSettings):
|
| 7 |
-
|
| 8 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
-
CONTEXT_SIZE: int = 65536
|
| 11 |
-
DEFAULT_MAX_TOKENS: int = 16384
|
| 12 |
DEFAULT_TEMP: float = 0.4
|
| 13 |
N_THREADS: int = 2
|
| 14 |
N_GPU_LAYERS: int = 0
|
|
|
|
| 4 |
|
| 5 |
|
| 6 |
class Settings(BaseSettings):
|
| 7 |
+
# Меняем на нужную нам супер-модель
|
| 8 |
+
REPO_ID: str = "empero-ai/Qwythos-9B-Claude-Mythos-5-1M-GGUF"
|
| 9 |
+
FILENAME: str = "Qwythos-9B-Claude-Mythos-5-1M-Q4_K_M.gguf"
|
| 10 |
+
|
| 11 |
+
CONTEXT_SIZE: int = 32768
|
| 12 |
+
DEFAULT_MAX_TOKENS: int = 8192
|
| 13 |
|
|
|
|
|
|
|
| 14 |
DEFAULT_TEMP: float = 0.4
|
| 15 |
N_THREADS: int = 2
|
| 16 |
N_GPU_LAYERS: int = 0
|
src/core/engine.py
CHANGED
|
@@ -25,6 +25,7 @@ class ModelEngine:
|
|
| 25 |
n_ctx=settings.CONTEXT_SIZE,
|
| 26 |
n_threads=settings.N_THREADS,
|
| 27 |
n_gpu_layers=settings.N_GPU_LAYERS,
|
|
|
|
| 28 |
verbose=True,
|
| 29 |
)
|
| 30 |
print("Model loaded successfully!")
|
|
|
|
| 25 |
n_ctx=settings.CONTEXT_SIZE,
|
| 26 |
n_threads=settings.N_THREADS,
|
| 27 |
n_gpu_layers=settings.N_GPU_LAYERS,
|
| 28 |
+
chat_format="chatml",
|
| 29 |
verbose=True,
|
| 30 |
)
|
| 31 |
print("Model loaded successfully!")
|