Instructions to use OpenMOSS-Team/AnyGPT-base with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use OpenMOSS-Team/AnyGPT-base with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="OpenMOSS-Team/AnyGPT-base")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("OpenMOSS-Team/AnyGPT-base") model = AutoModelForCausalLM.from_pretrained("OpenMOSS-Team/AnyGPT-base") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use OpenMOSS-Team/AnyGPT-base with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "OpenMOSS-Team/AnyGPT-base" # 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-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/OpenMOSS-Team/AnyGPT-base
- SGLang
How to use OpenMOSS-Team/AnyGPT-base 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-base" \ --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-base", "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-base" \ --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-base", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use OpenMOSS-Team/AnyGPT-base with Docker Model Runner:
docker model run hf.co/OpenMOSS-Team/AnyGPT-base
Improve model card: Add pipeline tag, library name, and detailed inference/training
#1
by nielsr HF Staff - opened
This PR significantly enhances the model card by adding relevant metadata and comprehensive content from the original GitHub repository.
Key improvements include:
- Metadata: Added
pipeline_tag: any-to-anyto correctly categorize the model and improve discoverability athttps://huggingface.co/models?pipeline_tag=any-to-any. Addedlibrary_name: transformersbased onconfig.jsonindicatingLlamaForCausalLMarchitecture andtransformers_version, which enables automated usage snippets on the model page. - Structure and Links: Updated the model card title and added prominent badges at the top linking to the paper, project page, and GitHub repository for easy access.
- Content Completeness: Integrated the "Open-Source Checklist," "Chat model CLI Inference" instructions, and the detailed "Pretraining and SFT" section from the project's GitHub README, providing a more complete guide for users.
- Typos: Corrected the "Lincese" heading to "License".
These updates will improve the model's visibility, usability, and overall presentation on the Hugging Face Hub.