Instructions to use nyanko7/llava-v1.6-34b-finetune with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nyanko7/llava-v1.6-34b-finetune with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="nyanko7/llava-v1.6-34b-finetune") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoProcessor, AutoModelForCausalLM processor = AutoProcessor.from_pretrained("nyanko7/llava-v1.6-34b-finetune") model = AutoModelForCausalLM.from_pretrained("nyanko7/llava-v1.6-34b-finetune") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use nyanko7/llava-v1.6-34b-finetune with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "nyanko7/llava-v1.6-34b-finetune" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nyanko7/llava-v1.6-34b-finetune", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/nyanko7/llava-v1.6-34b-finetune
- SGLang
How to use nyanko7/llava-v1.6-34b-finetune 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 "nyanko7/llava-v1.6-34b-finetune" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nyanko7/llava-v1.6-34b-finetune", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "nyanko7/llava-v1.6-34b-finetune" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "nyanko7/llava-v1.6-34b-finetune", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use nyanko7/llava-v1.6-34b-finetune with Docker Model Runner:
docker model run hf.co/nyanko7/llava-v1.6-34b-finetune
If is it posssible to release your finetune code?
If is it posssible to release your finetune code?
I use the offical llava1.6-34b model to finetune and encounter this error, have you meet this error, how to fix?
WARNING: tokenization mismatch: 1494 vs. 1495. (ignored)
WARNING: tokenization mismatch: 1548 vs. 1549. (ignored)
WARNING: tokenization mismatch: 1528 vs. 1529. (ignored)
WARNING: tokenization mismatch: 1494 vs. 1495. (ignored)
WARNING: tokenization mismatch: 1558 vs. 1559. (ignored)
WARNING: tokenization mismatch: 1465 vs. 1466. (ignored)
WARNING: tokenization mismatch: 1488 vs. 1489. (ignored)
WARNING: tokenization mismatch: 1788 vs. 1789. (ignored)
WARNING: tokenization mismatch: 1823 vs. 1824. (ignored)
WARNING: tokenization mismatch: 1757 vs. 1758. (ignored)
WARNING: tokenization mismatch: 1771 vs. 1772. (ignored)
WARNING: tokenization mismatch: 1755 vs. 1756. (ignored)
WARNING: tokenization mismatch: 1782 vs. 1783. (ignored)
WARNING: tokenization mismatch: 1806 vs. 1807. (ignored)
WARNING: tokenization mismatch: 1766 vs. 1767. (ignored)
WARNING: tokenization mismatch: 1669 vs. 1670. (ignored)
WARNING: tokenization mismatch: 1707 vs. 1708. (ignored)
WARNING: tokenization mismatch: 1754 vs. 1755. (ignored)
WARNING: tokenization mismatch: 1685 vs. 1686. (ignored)
WARNING: tokenization mismatch: 1612 vs. 1613. (ignored)
WARNING: tokenization mismatch: 1673 vs. 1674. (ignored)