Instructions to use hf-internal-testing/tiny-random-WhisperForCausalLM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use hf-internal-testing/tiny-random-WhisperForCausalLM with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="hf-internal-testing/tiny-random-WhisperForCausalLM")# Load model directly from transformers import AutoProcessor, AutoModelForCausalLM processor = AutoProcessor.from_pretrained("hf-internal-testing/tiny-random-WhisperForCausalLM") model = AutoModelForCausalLM.from_pretrained("hf-internal-testing/tiny-random-WhisperForCausalLM", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use hf-internal-testing/tiny-random-WhisperForCausalLM 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-WhisperForCausalLM" # 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-WhisperForCausalLM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/hf-internal-testing/tiny-random-WhisperForCausalLM
- SGLang
How to use hf-internal-testing/tiny-random-WhisperForCausalLM 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-WhisperForCausalLM" \ --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-WhisperForCausalLM", "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-WhisperForCausalLM" \ --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-WhisperForCausalLM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use hf-internal-testing/tiny-random-WhisperForCausalLM with Docker Model Runner:
docker model run hf.co/hf-internal-testing/tiny-random-WhisperForCausalLM
| { | |
| "activation_dropout": 0.0, | |
| "activation_function": "gelu", | |
| "apply_spec_augment": false, | |
| "architectures": [ | |
| "WhisperForCausalLM" | |
| ], | |
| "attention_dropout": 0.1, | |
| "begin_suppress_tokens": null, | |
| "bos_token_id": 50257, | |
| "classifier_proj_size": 256, | |
| "d_model": 16, | |
| "decoder_attention_heads": 4, | |
| "decoder_ffn_dim": 16, | |
| "decoder_layerdrop": 0.0, | |
| "decoder_layers": 2, | |
| "decoder_start_token_id": 85, | |
| "dropout": 0.1, | |
| "encoder_attention_heads": 4, | |
| "encoder_ffn_dim": 16, | |
| "encoder_layerdrop": 0.0, | |
| "encoder_layers": 2, | |
| "eos_token_id": 50257, | |
| "init_std": 0.02, | |
| "input_channels": 1, | |
| "is_decoder": true, | |
| "is_encoder_decoder": false, | |
| "mask_feature_length": 10, | |
| "mask_feature_min_masks": 0, | |
| "mask_feature_prob": 0.0, | |
| "mask_time_length": 10, | |
| "mask_time_min_masks": 2, | |
| "mask_time_prob": 0.05, | |
| "max_position_embeddings": 200, | |
| "max_source_positions": 200, | |
| "max_target_positions": 200, | |
| "median_filter_width": 7, | |
| "model_type": "whisper", | |
| "num_hidden_layers": 2, | |
| "num_mel_bins": 80, | |
| "pad_token_id": 50257, | |
| "scale_embedding": false, | |
| "torch_dtype": "float32", | |
| "transformers_version": "4.36.0.dev0", | |
| "use_cache": true, | |
| "use_weighted_layer_sum": false, | |
| "vocab_size": 51865 | |
| } | |