Instructions to use hf-internal-testing/tiny-random-MusicgenForCausalLM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use hf-internal-testing/tiny-random-MusicgenForCausalLM with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="hf-internal-testing/tiny-random-MusicgenForCausalLM")# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("hf-internal-testing/tiny-random-MusicgenForCausalLM", dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use hf-internal-testing/tiny-random-MusicgenForCausalLM 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-random-MusicgenForCausalLM" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "hf-internal-testing/tiny-random-MusicgenForCausalLM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/hf-internal-testing/tiny-random-MusicgenForCausalLM
- SGLang
How to use hf-internal-testing/tiny-random-MusicgenForCausalLM 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-random-MusicgenForCausalLM" \ --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": "hf-internal-testing/tiny-random-MusicgenForCausalLM", "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 "hf-internal-testing/tiny-random-MusicgenForCausalLM" \ --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": "hf-internal-testing/tiny-random-MusicgenForCausalLM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use hf-internal-testing/tiny-random-MusicgenForCausalLM with Docker Model Runner:
docker model run hf.co/hf-internal-testing/tiny-random-MusicgenForCausalLM
Upload MusicgenForCausalLM
Browse files- config.json +27 -0
- generation_config.json +7 -0
- pytorch_model.bin +3 -0
config.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"activation_dropout": 0.0,
|
| 3 |
+
"activation_function": "gelu",
|
| 4 |
+
"architectures": [
|
| 5 |
+
"MusicgenForCausalLM"
|
| 6 |
+
],
|
| 7 |
+
"attention_dropout": 0.0,
|
| 8 |
+
"bos_token_id": 99,
|
| 9 |
+
"decoder_start_token_id": 99,
|
| 10 |
+
"dropout": 0.1,
|
| 11 |
+
"ffn_dim": 4,
|
| 12 |
+
"hidden_size": 16,
|
| 13 |
+
"initializer_factor": 0.02,
|
| 14 |
+
"layerdrop": 0.0,
|
| 15 |
+
"max_position_embeddings": 2048,
|
| 16 |
+
"model_type": "musicgen_decoder",
|
| 17 |
+
"num_attention_heads": 4,
|
| 18 |
+
"num_codebooks": 4,
|
| 19 |
+
"num_hidden_layers": 2,
|
| 20 |
+
"pad_token_id": 99,
|
| 21 |
+
"scale_embedding": false,
|
| 22 |
+
"tie_word_embeddings": false,
|
| 23 |
+
"torch_dtype": "float32",
|
| 24 |
+
"transformers_version": "4.35.0.dev0",
|
| 25 |
+
"use_cache": true,
|
| 26 |
+
"vocab_size": 99
|
| 27 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 99,
|
| 4 |
+
"decoder_start_token_id": 99,
|
| 5 |
+
"pad_token_id": 99,
|
| 6 |
+
"transformers_version": "4.35.0.dev0"
|
| 7 |
+
}
|
pytorch_model.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:739a9a26a83079be0087d5b054c839c32cfbc54f725857faf79ef83f9f0f9c12
|
| 3 |
+
size 214319
|