Instructions to use hf-internal-testing/tiny-DbrxForCausalLM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use hf-internal-testing/tiny-DbrxForCausalLM with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="hf-internal-testing/tiny-DbrxForCausalLM") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("hf-internal-testing/tiny-DbrxForCausalLM") model = AutoModelForCausalLM.from_pretrained("hf-internal-testing/tiny-DbrxForCausalLM", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use hf-internal-testing/tiny-DbrxForCausalLM with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "hf-internal-testing/tiny-DbrxForCausalLM" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "hf-internal-testing/tiny-DbrxForCausalLM", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/hf-internal-testing/tiny-DbrxForCausalLM
- SGLang
How to use hf-internal-testing/tiny-DbrxForCausalLM 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 "hf-internal-testing/tiny-DbrxForCausalLM" \ --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": "hf-internal-testing/tiny-DbrxForCausalLM", "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 "hf-internal-testing/tiny-DbrxForCausalLM" \ --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": "hf-internal-testing/tiny-DbrxForCausalLM", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use hf-internal-testing/tiny-DbrxForCausalLM with Docker Model Runner:
docker model run hf.co/hf-internal-testing/tiny-DbrxForCausalLM
Commit History
-
This was causing test failures due to stricter config typing
Verified signature3408e3d
-
Upload config
Verified signature71d583a -
Upload DbrxForCausalLM
Verified signature27ad63b -
Update config.json
Verified signaturebefdc85
-
Upload config
Verified signaturefef7ef8 -
Upload DbrxForCausalLM
Verified signature4bc4a3f
-
Upload config
Verified signature1ffad91 -
Upload DbrxForCausalLM
Verified signatured3b7d7e
-
Upload DbrxForCausalLM
Verified signaturee379c59 -
Upload DbrxForCausalLM
Verified signatureedd786d -
Delete model.safetensors.index.json
Verified signaturee572c1c -
Delete model-00006-of-00006.safetensors
Verified signature1033d09 -
Delete model-00005-of-00006.safetensors
Verified signature9af02fd -
Delete model-00004-of-00006.safetensors
Verified signature4acd41f -
Delete model-00003-of-00006.safetensors
Verified signatureb522598 -
Delete model-00002-of-00006.safetensors
Verified signature70e8c5a -
Delete model-00001-of-00006.safetensors
Verified signaturea820c89 -
Upload DbrxForCausalLM
Verified signature480af8a -
Upload DbrxForCausalLM
Verified signature54e00cd -
Upload README.md with huggingface_hub
Verified signatureea3f74d -
Upload tokenizer
Verified signature808723e -
Upload DbrxForCausalLM
Verified signature3f9f58d -
initial commit
Verified signature43e9587