-
Notifications
You must be signed in to change notification settings - Fork 590
/
Copy pathDockerfile
38 lines (25 loc) · 1.43 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#---
# name: llama-factory
# group: llm
# requires: '>=35'
# depends: [bitsandbytes, flash-attention, vllm]
# test: test.py
# notes: LLaMA-Factory for Jetson - https://github.com/hiyouga/LLaMA-Factory
#---
ARG BASE_IMAGE
FROM ${BASE_IMAGE}
ADD https://api.github.com/repos/hiyouga/LLaMA-Factory/git/refs/heads/main /tmp/llama_factory_version.json
RUN git clone --depth=1 https://github.com/hiyouga/LLaMA-Factory.git /opt/llama-factory && \
cd /opt/llama-factory && \
sed 's|DEFAULT_CACHE_DIR = "cache"|DEFAULT_CACHE_DIR = os.environ.get("LLAMA_FACTORY_CACHE_DIR", "/data/llama-factory/cache")|' -i ./src/llamafactory/webui/common.py && \
sed 's|DEFAULT_CONFIG_DIR = "config"|DEFAULT_CONFIG_DIR = os.environ.get("LLAMA_FACTORY_CONFIG_DIR", "/data/llama-factory/config")|' -i ./src/llamafactory/webui/common.py && \
sed 's|DEFAULT_DATA_DIR = "data"|DEFAULT_DATA_DIR = os.environ.get("LLAMA_FACTORY_DATA_DIR", "/data/llama-factory/data")|' -i ./src/llamafactory/webui/common.py && \
sed 's|DEFAULT_SAVE_DIR = "saves"|DEFAULT_SAVE_DIR = os.environ.get("LLAMA_FACTORY_SAVE_DIR", "/data/llama-factory/saves")|' -i ./src/llamafactory/webui/common.py && \
sed -i 's|"vllm>=0.4.3,<=0.6.0"|"vllm>=0.4.3,<=0.6.4"|' setup.py && \
cat ./src/llamafactory/webui/common.py && \
pip3 install -e ".[metrics]" && \
pip3 install openai
ENV GRADIO_SERVER_PORT=7860 \
API_PORT=8000
EXPOSE 7860 8000
CMD ["llamafactory-cli", "webui"]