forked from haotian-liu/LLaVA
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e61aa3f
commit 2fde4a9
Showing
9 changed files
with
260 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
FROM mcr.microsoft.com/devcontainers/base:ubuntu-20.04 | ||
|
||
SHELL [ "bash", "-c" ] | ||
|
||
# update apt and install packages | ||
RUN apt update && \ | ||
apt install -yq \ | ||
ffmpeg \ | ||
dkms \ | ||
build-essential | ||
|
||
# add user tools | ||
RUN sudo apt install -yq \ | ||
jq \ | ||
jp \ | ||
tree \ | ||
tldr | ||
|
||
# add git-lfs and install | ||
RUN curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash && \ | ||
sudo apt-get install -yq git-lfs && \ | ||
git lfs install | ||
|
||
############################################ | ||
# Setup user | ||
############################################ | ||
|
||
USER vscode | ||
|
||
# install azcopy, a tool to copy to/from blob storage | ||
# for more info: https://learn.microsoft.com/en-us/azure/storage/common/storage-use-azcopy-blobs-upload#upload-a-file | ||
RUN cd /tmp && \ | ||
wget https://azcopyvnext.azureedge.net/release20230123/azcopy_linux_amd64_10.17.0.tar.gz && \ | ||
tar xvf azcopy_linux_amd64_10.17.0.tar.gz && \ | ||
mkdir -p ~/.local/bin && \ | ||
mv azcopy_linux_amd64_10.17.0/azcopy ~/.local/bin && \ | ||
chmod +x ~/.local/bin/azcopy && \ | ||
rm -rf azcopy_linux_amd64* | ||
|
||
# Setup conda | ||
RUN cd /tmp && \ | ||
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \ | ||
bash ./Miniconda3-latest-Linux-x86_64.sh -b && \ | ||
rm ./Miniconda3-latest-Linux-x86_64.sh | ||
|
||
# Install dotnet | ||
RUN cd /tmp && \ | ||
wget https://dot.net/v1/dotnet-install.sh && \ | ||
chmod +x dotnet-install.sh && \ | ||
./dotnet-install.sh --channel 7.0 && \ | ||
./dotnet-install.sh --channel 3.1 && \ | ||
rm ./dotnet-install.sh | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Efficient AI | ||
EFFICIENT_AI_SUBSCRIPTION_NAME="Efficient AI" | ||
EFFICIENT_AI_SUBSCRIPTION_ID=332431bf-68bf-46f9-ab8b-c7bfe2197219 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
{ | ||
"name": "LLaVA", | ||
"build": { | ||
"dockerfile": "Dockerfile", | ||
"context": "..", | ||
"args": {} | ||
}, | ||
"features": { | ||
"ghcr.io/devcontainers/features/docker-in-docker:2": {}, | ||
"ghcr.io/devcontainers/features/azure-cli:1": {}, | ||
"ghcr.io/azure/azure-dev/azd:0": {}, | ||
"ghcr.io/devcontainers/features/powershell:1": {}, | ||
// "ghcr.io/devcontainers/features/common-utils:2": {}, | ||
// "ghcr.io/devcontainers-contrib/features/zsh-plugins:0": { | ||
// "omzPlugins": "https://github.com/zsh-users/zsh-autosuggestions", | ||
// }, | ||
}, | ||
// "forwardPorts": [], | ||
"postCreateCommand": "bash ./.devcontainer/postCreateCommand.sh", | ||
"customizations": { | ||
"vscode": { | ||
"settings": { | ||
"python.analysis.autoImportCompletions": true, | ||
"python.analysis.autoImportUserSymbols": true, | ||
"python.defaultInterpreterPath": "~/miniconda3/envs/llava/bin/python", | ||
"python.formatting.provider": "yapf", | ||
"python.linting.enabled": true, | ||
"python.linting.flake8Enabled": true, | ||
"isort.check": true, | ||
"dev.containers.copyGitConfig": true, | ||
"terminal.integrated.defaultProfile.linux": "zsh", | ||
"terminal.integrated.profiles.linux": { | ||
"zsh": { | ||
"path": "/usr/bin/zsh" | ||
}, | ||
} | ||
}, | ||
"extensions": [ | ||
"aaron-bond.better-comments", | ||
"eamodio.gitlens", | ||
"EditorConfig.EditorConfig", | ||
"foxundermoon.shell-format", | ||
"GitHub.copilot-chat", | ||
"GitHub.copilot-labs", | ||
"GitHub.copilot", | ||
"lehoanganh298.json-lines-viewer", | ||
"mhutchie.git-graph", | ||
"ms-azuretools.vscode-docker", | ||
"ms-dotnettools.dotnet-interactive-vscode", | ||
"ms-python.flake8", | ||
"ms-python.isort", | ||
"ms-python.python", | ||
"ms-python.vscode-pylance", | ||
"njpwerner.autodocstring", | ||
"redhat.vscode-yaml", | ||
"stkb.rewrap", | ||
"yzhang.markdown-all-in-one", | ||
] | ||
} | ||
}, | ||
"mounts": [], | ||
"runArgs": [ | ||
"--gpus", | ||
"all", | ||
// "--ipc", | ||
// "host", | ||
"--ulimit", | ||
"memlock=-1", | ||
"--env-file", | ||
".devcontainer/devcontainer.env" | ||
], | ||
// "remoteUser": "root" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
git config --global safe.directory '*' | ||
git config --global core.editor "code --wait" | ||
git config --global pager.branch false | ||
|
||
# Set AZCOPY concurrency to auto | ||
echo "export AZCOPY_CONCURRENCY_VALUE=AUTO" >> ~/.zshrc | ||
echo "export AZCOPY_CONCURRENCY_VALUE=AUTO" >> ~/.bashrc | ||
|
||
# Activate conda by default | ||
echo ". /home/vscode/miniconda3/bin/activate" >> ~/.zshrc | ||
echo ". /home/vscode/miniconda3/bin/activate" >> ~/.bashrc | ||
|
||
# Use llava environment by default | ||
echo "conda activate llava" >> ~/.zshrc | ||
echo "conda activate llava" >> ~/.bashrc | ||
|
||
# Add dotnet to PATH | ||
echo 'export PATH="$PATH:$HOME/.dotnet"' >> ~/.bashrc | ||
echo 'export PATH="$PATH:$HOME/.dotnet"' >> ~/.zshrc | ||
|
||
# Create and activate llava environment | ||
source /home/vscode/miniconda3/bin/activate | ||
conda create -y -q -n llava python=3.10 | ||
conda activate llava | ||
|
||
# Install Nvidia Cuda Compiler | ||
conda install -y -c nvidia cuda-compiler | ||
|
||
pip install pre-commit==3.0.2 | ||
|
||
# Install package locally | ||
pip install --upgrade pip # enable PEP 660 support | ||
pip install -e . | ||
|
||
# Install additional packages for training | ||
pip install -e ".[train]" | ||
pip install flash-attn --no-build-isolation | ||
|
||
# Download checkpoints to location outside of the repo | ||
git clone https://huggingface.co/liuhaotian/llava-v1.5-7b ~/llava-v1.5-7b | ||
|
||
# Commented because it is unlikely for users to have enough local GPU memory to load the model | ||
# git clone https://huggingface.co/liuhaotian/llava-v1.5-13b ~/llava-v1.5-13b | ||
|
||
echo "postCreateCommand.sh COMPLETE!" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
root = true | ||
|
||
# Unix-style newlines with a newline ending every file | ||
[*] | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
charset = utf-8 | ||
|
||
# 4 space indentation | ||
[*.{py,json}] | ||
indent_style = space | ||
indent_size = 4 | ||
|
||
# 2 space indentation | ||
[*.{md,sh,yaml,yml}] | ||
indent_style = space | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# https://git-scm.com/docs/gitattributes | ||
|
||
# Set the default behavior, in case people don't have core.autocrlf set. | ||
# https://git-scm.com/docs/gitattributes#_end_of_line_conversion | ||
* text=auto | ||
|
||
# common python attributes, taken from https://github.com/alexkaratarakis/gitattributes/blob/710900479a2bedeec7003d381719521ffbb18bf8/Python.gitattributes | ||
# Source files | ||
# ============ | ||
*.pxd text diff=python | ||
*.py text diff=python | ||
*.py3 text diff=python | ||
*.pyw text diff=python | ||
*.pyx text diff=python | ||
*.pyz text diff=python | ||
*.pyi text diff=python | ||
|
||
# Binary files | ||
# ============ | ||
*.db binary | ||
*.p binary | ||
*.pkl binary | ||
*.pickle binary | ||
*.pyc binary export-ignore | ||
*.pyo binary export-ignore | ||
*.pyd binary | ||
|
||
# Jupyter notebook | ||
*.ipynb text eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Issue | ||
|
||
<!-- Describe the issue your pull request addressing --> | ||
|
||
# Solution | ||
|
||
<!-- Describe the changes made to address the issue above --> | ||
|
||
## Video or Screenshots | ||
|
||
<!-- If you made changes to experience or documentation please include visuals or video to demonstrate the changes --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,3 +27,9 @@ ckpts* | |
|
||
.ipynb_checkpoints | ||
*.ipynb | ||
|
||
# DevContainer | ||
!.devcontainer/* | ||
|
||
# Demo | ||
serve_images/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Python: llava.serve.cli", | ||
"type": "python", | ||
"request": "launch", | ||
"module": "llava.serve.cli", | ||
"justMyCode": true, | ||
"args": [ | ||
"--model-path", | ||
"/workspaces/LLaVA/llava-v1.5-7b", | ||
"--image-file", | ||
"https://llava-vl.github.io/static/images/view.jpg", | ||
"--load-4bit" | ||
] | ||
} | ||
] | ||
} |