Instructions to use leloy/Anole-7b-v0.1-hf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use leloy/Anole-7b-v0.1-hf with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="leloy/Anole-7b-v0.1-hf")# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("leloy/Anole-7b-v0.1-hf") model = AutoModelForMultimodalLM.from_pretrained("leloy/Anole-7b-v0.1-hf", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use leloy/Anole-7b-v0.1-hf with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "leloy/Anole-7b-v0.1-hf" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "leloy/Anole-7b-v0.1-hf", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/leloy/Anole-7b-v0.1-hf
- SGLang
How to use leloy/Anole-7b-v0.1-hf 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 "leloy/Anole-7b-v0.1-hf" \ --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": "leloy/Anole-7b-v0.1-hf", "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 "leloy/Anole-7b-v0.1-hf" \ --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": "leloy/Anole-7b-v0.1-hf", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use leloy/Anole-7b-v0.1-hf with Docker Model Runner:
docker model run hf.co/leloy/Anole-7b-v0.1-hf
Anole: An Open, Autoregressive and Native Multimodal Models for Interleaved Image-Text Generation
Note: This is a huggingface-compatible version of the model converted by leloy. Currently only works on this branch of the Transformers library.
Anole is the first open-source, autoregressive, and natively trained large multimodal model capable of interleaved image-text generation (without using stable diffusion). While it builds upon the strengths of Chameleon, Anole excels at the complex task of generating coherent sequences of alternating text and images. Through an innovative fine-tuning process using a carefully curated dataset of approximately 6,000 images, Anole achieves remarkable image generation and understanding capabilities with minimal additional training. This efficient approach, combined with its open-source nature, positions Anole as a catalyst for accelerated research and development in multimodal AI. Preliminary tests demonstrate Anole's exceptional ability to follow nuanced instructions, producing high-quality images and interleaved text-image content that closely aligns with user prompts.
The major functionalities of Anole are listed below:
- Interleaved Text-Image Structured Generation (support added by leloy)
- Text-to-Image Generation
- Interleaved Text-Image Generation
- Text Generation
- MultiModal Understanding
where Bold represents newly added capabilities on the basis of Chameleon.
Please refer to our github repo for examples generated by Anole!
- Downloads last month
- 1,598
Install from pip and serve model
# Install vLLM from pip: pip install vllm# Start the vLLM server: vllm serve "leloy/Anole-7b-v0.1-hf"# Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "leloy/Anole-7b-v0.1-hf", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'