Instructions to use Dogge/alpaca-13b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Dogge/alpaca-13b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Dogge/alpaca-13b")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Dogge/alpaca-13b") model = AutoModelForCausalLM.from_pretrained("Dogge/alpaca-13b") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Dogge/alpaca-13b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Dogge/alpaca-13b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Dogge/alpaca-13b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Dogge/alpaca-13b
- SGLang
How to use Dogge/alpaca-13b with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Dogge/alpaca-13b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Dogge/alpaca-13b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Dogge/alpaca-13b" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Dogge/alpaca-13b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Dogge/alpaca-13b with Docker Model Runner:
docker model run hf.co/Dogge/alpaca-13b
How long train on 13B
using 4 * A100 80GB GPU,
how much time will cost on train 13B data
it seem to train 7B about 24 hours?
the same command with stanford alpaca
https://github.com/tatsu-lab/stanford_alpaca#fine-tuning
torchrun --nproc_per_node=4 --master_port= train.py
--model_name_or_path
--data_path ./alpaca_data.json
--bf16 True
--output_dir
--num_train_epochs 3
--per_device_train_batch_size 4
--per_device_eval_batch_size 4
--gradient_accumulation_steps 8
--evaluation_strategy "no"
--save_strategy "steps"
--save_steps 2000
--save_total_limit 1
--learning_rate 2e-5
--weight_decay 0.
--warmup_ratio 0.03
--lr_scheduler_type "cosine"
--logging_steps 1
--fsdp "full_shard auto_wrap"
--fsdp_transformer_layer_cls_to_wrap 'LLaMADecoderLayer'
--tf32 True
it is the best way to accelerate?
fsdp = ShardingStrategy.FULL_SHARD
I used https://github.com/tloen/alpaca-lora.git finetune.py before export_hf_checkpoint.py
maybe it takes 10hours less.
here is my repo include 13B code.
Sir the model doesn't load how do we fix it? What do you use to run the model? Also isn't that for LORAs not full fine tunes?