Instructions to use maicomputer/alpaca-native with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use maicomputer/alpaca-native with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="maicomputer/alpaca-native")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("maicomputer/alpaca-native") model = AutoModelForCausalLM.from_pretrained("maicomputer/alpaca-native", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use maicomputer/alpaca-native with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "maicomputer/alpaca-native" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "maicomputer/alpaca-native", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/maicomputer/alpaca-native
- SGLang
How to use maicomputer/alpaca-native 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 "maicomputer/alpaca-native" \ --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": "maicomputer/alpaca-native", "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 "maicomputer/alpaca-native" \ --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": "maicomputer/alpaca-native", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use maicomputer/alpaca-native with Docker Model Runner:
docker model run hf.co/maicomputer/alpaca-native
Download README.md from maicomputer/alpaca-native: direct link, hf CLI and curl.
- Browser
- Download file 1.48 kB
-
https://huggingface.co/maicomputer/alpaca-native/resolve/refs%2Fpr%2F21/README.md
- Command line
-
hf download hf://maicomputer/alpaca-native@refs/pr/21/README.md
-
curl -L -o README.md https://huggingface.co/maicomputer/alpaca-native/resolve/refs%2Fpr%2F21/README.md
Stanford Alpaca
This is a replica of Alpaca by Stanford' tatsu
Trained using the original instructions with a minor modification in FSDP mode
Other versions:
13B: https://huggingface.co/chavinlo/alpaca-13b
13B -> GPT4 : https://huggingface.co/chavinlo/gpt4-x-alpaca
Compute Used
Trained on 4xA100s for 6H Donated by redmond.ai
NO LORA HAS BEEN USED, this is a natively-finetuned model, hence "alpaca-native"
If you are interested on more llama-based models, you can check out my profile or search for other models at https://huggingface.co/models?other=llama
This (MIGHT) be a quantized version of this model, but be careful: https://boards.4channel.org/g/thread/92173062#p92182396
CONFIGURATION (default except fsdp):
torchrun --nproc_per_node=4 --master_port=3045 train.py \
--model_name_or_path /workspace/llama-7b-hf \
--data_path ./alpaca_data.json \
--bf16 True \
--output_dir /workspace/output \
--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 200 \
--save_total_limit 1 \
--learning_rate 2e-5 \
--weight_decay 0. \
--warmup_ratio 0.03 \
--lr_scheduler_type "cosine" \
--logging_steps 1 \
--fsdp "shard_grad_op auto_wrap" \
--fsdp_transformer_layer_cls_to_wrap 'LLaMADecoderLayer' \
--tf32 True --report_to="wandb"