Instructions to use fine-tune/test_v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use fine-tune/test_v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="fine-tune/test_v2")# Load model directly from transformers import AutoTokenizer, AutoModelForImageTextToText tokenizer = AutoTokenizer.from_pretrained("fine-tune/test_v2") model = AutoModelForImageTextToText.from_pretrained("fine-tune/test_v2") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use fine-tune/test_v2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "fine-tune/test_v2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "fine-tune/test_v2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/fine-tune/test_v2
- SGLang
How to use fine-tune/test_v2 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 "fine-tune/test_v2" \ --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": "fine-tune/test_v2", "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 "fine-tune/test_v2" \ --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": "fine-tune/test_v2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use fine-tune/test_v2 with Docker Model Runner:
docker model run hf.co/fine-tune/test_v2
File size: 1,758 Bytes
1305482 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 | {
"architectures": [
"VisionEncoderDecoderModel"
],
"decoder": {
"activation_dropout": 0.0,
"activation_function": "gelu",
"add_cross_attention": true,
"add_final_layer_norm": true,
"attention_dropout": 0.0,
"classifier_dropout": 0.0,
"d_model": 1024,
"decoder_attention_heads": 16,
"decoder_ffn_dim": 4096,
"decoder_layerdrop": 0.0,
"decoder_layers": 4,
"dropout": 0.1,
"encoder_attention_heads": 16,
"encoder_ffn_dim": 4096,
"encoder_layerdrop": 0.0,
"encoder_layers": 12,
"init_std": 0.02,
"is_decoder": true,
"is_encoder_decoder": false,
"max_length": 768,
"max_position_embeddings": 1536,
"model_type": "mbart",
"num_hidden_layers": 12,
"scale_embedding": true,
"torch_dtype": "float32",
"use_cache": true,
"vocab_size": 57550
},
"decoder_start_token_id": 57549,
"encoder": {
"attention_probs_dropout_prob": 0.0,
"depths": [
2,
2,
14,
2
],
"drop_path_rate": 0.1,
"embed_dim": 128,
"hidden_act": "gelu",
"hidden_dropout_prob": 0.0,
"hidden_size": 1024,
"image_size": [
1800,
825
],
"initializer_range": 0.02,
"layer_norm_eps": 1e-05,
"mlp_ratio": 4.0,
"model_type": "donut-swin",
"num_channels": 3,
"num_heads": [
4,
8,
16,
32
],
"num_layers": 4,
"patch_size": 4,
"path_norm": true,
"qkv_bias": true,
"torch_dtype": "float32",
"use_absolute_embeddings": false,
"window_size": 10
},
"is_encoder_decoder": true,
"model_type": "vision-encoder-decoder",
"pad_token_id": 1,
"tie_word_embeddings": false,
"torch_dtype": "float32",
"transformers_version": "4.51.1"
}
|