Instructions to use OpenMOSS-Team/AnyGPT-chat with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OpenMOSS-Team/AnyGPT-chat with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="OpenMOSS-Team/AnyGPT-chat")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("OpenMOSS-Team/AnyGPT-chat") model = AutoModelForCausalLM.from_pretrained("OpenMOSS-Team/AnyGPT-chat") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use OpenMOSS-Team/AnyGPT-chat with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "OpenMOSS-Team/AnyGPT-chat" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "OpenMOSS-Team/AnyGPT-chat", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/OpenMOSS-Team/AnyGPT-chat
- SGLang
How to use OpenMOSS-Team/AnyGPT-chat 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 "OpenMOSS-Team/AnyGPT-chat" \ --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": "OpenMOSS-Team/AnyGPT-chat", "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 "OpenMOSS-Team/AnyGPT-chat" \ --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": "OpenMOSS-Team/AnyGPT-chat", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use OpenMOSS-Team/AnyGPT-chat with Docker Model Runner:
docker model run hf.co/OpenMOSS-Team/AnyGPT-chat
Improve model card: Add pipeline tag, library name, paper, code, and project page links
#1
by nielsr HF Staff - opened
This PR significantly enhances the model card for AnyGPT: Unified Multimodal LLM with Discrete Sequence Modeling by:
- Adding the
pipeline_tag: any-to-anyto the metadata, which accurately reflects the model's multimodal capabilities and improves discoverability on the Hugging Face Hub (e.g., at https://huggingface.co/models?pipeline_tag=any-to-any). - Adding
library_name: transformersto the metadata. This is supported by theconfig.jsonfile (showingLlamaForCausalLMandtransformers_version), enabling the automated "how to use" widget and code snippets for thetransformerslibrary. - Adding prominent direct links to the Hugging Face paper page (https://huggingface.co/papers/2402.12226), the GitHub repository (https://github.com/OpenMOSS/AnyGPT), and the project page (https://junzhan2000.github.io/AnyGPT.github.io/) at the very top of the model card content. This provides users with immediate access to key resources.
These additions improve the model's visibility, usability, and compliance with Hugging Face Hub best practices.