MCPcopy Index your code
hub / github.com/OpenGVLab/LLaMA-Adapter

github.com/OpenGVLab/LLaMA-Adapter @v.2.1.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v.2.1.0 ↗ · + Follow
1,572 symbols 3,924 edges 160 files 130 documented · 8% updated 2y agov.2.1.0 · 2023-10-12★ 5,919131 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

LLaMA

This repository is intended as a minimal, hackable and readable example to load LLaMA (arXiv) models and run inference. In order to download the checkpoints and tokenizer, fill this google form

Setup

In a conda env with pytorch / cuda available, run:

pip install -r requirements.txt

Then in this repository:

pip install -e .

Download

Once your request is approved, you will receive links to download the tokenizer and model files. Edit the download.sh script with the signed url provided in the email to download the model weights and tokenizer.

Inference

The provided example.py can be run on a single or multi-gpu node with torchrun and will output completions for two pre-defined prompts. Using TARGET_FOLDER as defined in download.sh:

torchrun --nproc_per_node MP example.py --ckpt_dir $TARGET_FOLDER/model_size --tokenizer_path $TARGET_FOLDER/tokenizer.model

Different models require different MP values:

Model MP
7B 1
13B 2
33B 4
65B 8

FAQ

Reference

LLaMA: Open and Efficient Foundation Language Models -- https://arxiv.org/abs/2302.13971

@article{touvron2023llama,
  title={LLaMA: Open and Efficient Foundation Language Models},
  author={Touvron, Hugo and Lavril, Thibaut and Izacard, Gautier and Martinet, Xavier and Lachaux, Marie-Anne and Lacroix, Timoth{\'e}e and Rozi{\`e}re, Baptiste and Goyal, Naman and Hambro, Eric and Azhar, Faisal and Rodriguez, Aurelien and Joulin, Armand and Grave, Edouard and Lample, Guillaume},
  journal={arXiv preprint arXiv:2302.13971},
  year={2023}
}

Model Card

See MODEL_CARD.md

License

See the LICENSE file.

Core symbols most depended-on inside this repo

print
called by 118
gorilla/finetune/util/misc.py
print
called by 69
imagebind_LLM/util/misc.py
print
called by 56
llama_adapter_v2_multimodal7b/util/misc.py
tree_to_variable_index
called by 50
gorilla/gorilla-main/eval/eval-scripts/codebleu/parser/utils.py
print
called by 31
alpaca_finetuning_v1/util/misc.py
print
called by 31
gorilla/alpaca_finetuning_v1/util/misc.py
copy
called by 29
gorilla/gorilla-main/inference/serve/conv_template.py
print
called by 22
llama_adapter_v2_chat65b/util/misc.py

Shape

Method 978
Function 363
Class 231

Languages

Python100%
TypeScript1%

Modules by API surface

gorilla/gorilla-main/eval/eval-scripts/codebleu/parser/tree-sitter-python/examples/python3.8_grammar.py155 symbols
gorilla/gorilla-main/eval/eval-scripts/codebleu/parser/tree-sitter-python/examples/python2-grammar.py101 symbols
gorilla/gorilla-main/eval/eval-scripts/codebleu/parser/tree-sitter-python/examples/python2-grammar-crlf.py101 symbols
gorilla/gorilla-main/eval/eval-scripts/codebleu/parser/tree-sitter-python/examples/python3-grammar.py98 symbols
gorilla/gorilla-main/eval/eval-scripts/codebleu/parser/tree-sitter-python/examples/python3-grammar-crlf.py98 symbols
imagebind_LLM/ImageBind/models/multimodal_preprocessors.py49 symbols
llama_adapter_v2_multimodal7b/util/misc.py42 symbols
imagebind_LLM/util/misc.py42 symbols
gorilla/finetune/util/misc.py38 symbols
llama_adapter_v2_chat65b/util/misc.py35 symbols
gorilla/alpaca_finetuning_v1/util/misc.py35 symbols
alpaca_finetuning_v1/util/misc.py35 symbols

Dependencies from manifests, versioned

nan2.15.0 · 1×
tree-sitter-cli0.20.1 · 1×
accelerate0.19.0 · 1×
decord0.6.0 · 1×
huggingface-hub0.14.1 · 1×
prompt_toolkit3.0.38 · 1×
sentencepiece0.1.99 · 1×
timm0.6.7 · 1×
torch2.0.0 · 1×
torchaudio0.13.0 · 1×
torchvision0.15.1 · 1×
tqdm4.65.0 · 1×

For agents

$ claude mcp add LLaMA-Adapter \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact