Instructions to use wza/stock_multi_modal with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use wza/stock_multi_modal with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="wza/stock_multi_modal")# Load model directly from transformers import AutoProcessor, AutoModelForCausalLM processor = AutoProcessor.from_pretrained("wza/stock_multi_modal") model = AutoModelForCausalLM.from_pretrained("wza/stock_multi_modal", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use wza/stock_multi_modal with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "wza/stock_multi_modal" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "wza/stock_multi_modal", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/wza/stock_multi_modal
- SGLang
How to use wza/stock_multi_modal 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 "wza/stock_multi_modal" \ --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": "wza/stock_multi_modal", "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 "wza/stock_multi_modal" \ --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": "wza/stock_multi_modal", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use wza/stock_multi_modal with Docker Model Runner:
docker model run hf.co/wza/stock_multi_modal
| # Description | |
| Trained on top of llava-13b-v1: https://huggingface.co/wza/llava-13b-v1 (github: https://github.com/haotian-liu/LLaVA) | |
| # Dataset | |
| Constructed dataset on stock k lines, both pre-train and instrcution-tune | |
| # Training scripts | |
| pre-train: | |
| ``` | |
| torchrun --nnodes=1 --nproc_per_node=8 --master_port=25001 \ | |
| LLaVA/llava/train/train_mem.py \ | |
| --model_name_or_path llava-13b-v1 \ | |
| --data_path JsonFormatDataset/PretrainData/data.json \ | |
| --image_folder JsonFormatDataset/PretrainData/images \ | |
| --vision_tower openai/clip-vit-large-patch14 \ | |
| --tune_mm_mlp_adapter True \ | |
| --mm_vision_select_layer -2 \ | |
| --mm_use_im_start_end \ | |
| --bf16 True \ | |
| --output_dir ./checkpoints/llava-13b-pretrain \ | |
| --num_train_epochs 1 \ | |
| --per_device_train_batch_size 8 \ | |
| --per_device_eval_batch_size 4 \ | |
| --gradient_accumulation_steps 2 \ | |
| --evaluation_strategy "no" \ | |
| --save_strategy "steps" \ | |
| --save_steps 2400 \ | |
| --save_total_limit 1 \ | |
| --learning_rate 2e-3 \ | |
| --weight_decay 0. \ | |
| --warmup_ratio 0.03 \ | |
| --lr_scheduler_type "cosine" \ | |
| --logging_steps 1 \ | |
| --tf32 True \ | |
| --model_max_length 2048 \ | |
| --gradient_checkpointing True \ | |
| --lazy_preprocess True \ | |
| --report_to wandb | |
| ``` | |
| instruction: | |
| ``` | |
| torchrun --nnodes=1 --nproc_per_node=8 --master_port=25001 \ | |
| LLaVA/llava/train/train_mem.py \ | |
| --model_name_or_path ./checkpoints/llava-13b-pretrain \ | |
| --data_path JsonFormatDataset/InstructionTuneData/data.json \ | |
| --image_folder JsonFormatDataset/InstructionTuneData/images/ \ | |
| --vision_tower openai/clip-vit-large-patch14 \ | |
| --mm_vision_select_layer -2 \ | |
| --mm_use_im_start_end \ | |
| --bf16 True \ | |
| --output_dir ./checkpoints/llava-13b-instruction \ | |
| --num_train_epochs 3 \ | |
| --per_device_train_batch_size 4 \ | |
| --per_device_eval_batch_size 4 \ | |
| --gradient_accumulation_steps 1 \ | |
| --evaluation_strategy "no" \ | |
| --save_strategy "steps" \ | |
| --save_steps 5000 \ | |
| --save_total_limit 3 \ | |
| --learning_rate 2e-5 \ | |
| --weight_decay 0. \ | |
| --warmup_ratio 0.03 \ | |
| --lr_scheduler_type "cosine" \ | |
| --logging_steps 1 \ | |
| --tf32 True \ | |
| --fsdp "full_shard auto_wrap" \ | |
| --fsdp_transformer_layer_cls_to_wrap 'LlamaDecoderLayer' \ | |
| --model_max_length 2048 \ | |
| --gradient_checkpointing True \ | |
| --lazy_preprocess True \ | |
| --report_to wandb | |
| ``` | |
| # Training settings | |
| 8xA100-80G-sxm4 | |
| Pre-train: https://wandb.ai/wzaa/huggingface/runs/cd5ou876/overview?workspace=user-wangziao1993 | |
| Fine-tune: https://wandb.ai/wzaa/huggingface/runs/y5bsz8dw/overview?workspace=user-wangziao1993 |