Instructions to use ncauchi1/pointing_demo_fixed_adapter_script-upload with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ncauchi1/pointing_demo_fixed_adapter_script-upload with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="ncauchi1/pointing_demo_fixed_adapter_script-upload") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("ncauchi1/pointing_demo_fixed_adapter_script-upload") model = AutoModelForMultimodalLM.from_pretrained("ncauchi1/pointing_demo_fixed_adapter_script-upload") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.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=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ncauchi1/pointing_demo_fixed_adapter_script-upload with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ncauchi1/pointing_demo_fixed_adapter_script-upload" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ncauchi1/pointing_demo_fixed_adapter_script-upload", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/ncauchi1/pointing_demo_fixed_adapter_script-upload
- SGLang
How to use ncauchi1/pointing_demo_fixed_adapter_script-upload 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 "ncauchi1/pointing_demo_fixed_adapter_script-upload" \ --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": "ncauchi1/pointing_demo_fixed_adapter_script-upload", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'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 "ncauchi1/pointing_demo_fixed_adapter_script-upload" \ --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": "ncauchi1/pointing_demo_fixed_adapter_script-upload", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use ncauchi1/pointing_demo_fixed_adapter_script-upload with Docker Model Runner:
docker model run hf.co/ncauchi1/pointing_demo_fixed_adapter_script-upload
Upload processor
Browse files- preprocessor_config.json +29 -0
- tokenizer_config.json +1 -0
- video_preprocessor_config.json +86 -0
preprocessor_config.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"do_convert_rgb": true,
|
| 3 |
+
"do_normalize": true,
|
| 4 |
+
"do_rescale": true,
|
| 5 |
+
"do_resize": true,
|
| 6 |
+
"image_mean": [
|
| 7 |
+
0.48145466,
|
| 8 |
+
0.4578275,
|
| 9 |
+
0.40821073
|
| 10 |
+
],
|
| 11 |
+
"image_processor_type": "Qwen2VLImageProcessor",
|
| 12 |
+
"image_std": [
|
| 13 |
+
0.26862954,
|
| 14 |
+
0.26130258,
|
| 15 |
+
0.27577711
|
| 16 |
+
],
|
| 17 |
+
"max_pixels": 12845056,
|
| 18 |
+
"merge_size": 2,
|
| 19 |
+
"min_pixels": 3136,
|
| 20 |
+
"patch_size": 14,
|
| 21 |
+
"processor_class": "Qwen2_5_VLProcessor",
|
| 22 |
+
"resample": 3,
|
| 23 |
+
"rescale_factor": 0.00392156862745098,
|
| 24 |
+
"size": {
|
| 25 |
+
"longest_edge": 12845056,
|
| 26 |
+
"shortest_edge": 3136
|
| 27 |
+
},
|
| 28 |
+
"temporal_patch_size": 2
|
| 29 |
+
}
|
tokenizer_config.json
CHANGED
|
@@ -201,6 +201,7 @@
|
|
| 201 |
"extra_special_tokens": {},
|
| 202 |
"model_max_length": 131072,
|
| 203 |
"pad_token": "<|endoftext|>",
|
|
|
|
| 204 |
"split_special_tokens": false,
|
| 205 |
"tokenizer_class": "Qwen2Tokenizer",
|
| 206 |
"unk_token": null
|
|
|
|
| 201 |
"extra_special_tokens": {},
|
| 202 |
"model_max_length": 131072,
|
| 203 |
"pad_token": "<|endoftext|>",
|
| 204 |
+
"processor_class": "Qwen2_5_VLProcessor",
|
| 205 |
"split_special_tokens": false,
|
| 206 |
"tokenizer_class": "Qwen2Tokenizer",
|
| 207 |
"unk_token": null
|
video_preprocessor_config.json
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_valid_kwargs_names": [
|
| 3 |
+
"do_convert_rgb",
|
| 4 |
+
"do_resize",
|
| 5 |
+
"size",
|
| 6 |
+
"size_divisor",
|
| 7 |
+
"default_to_square",
|
| 8 |
+
"resample",
|
| 9 |
+
"do_rescale",
|
| 10 |
+
"rescale_factor",
|
| 11 |
+
"do_normalize",
|
| 12 |
+
"image_mean",
|
| 13 |
+
"image_std",
|
| 14 |
+
"do_pad",
|
| 15 |
+
"do_center_crop",
|
| 16 |
+
"crop_size",
|
| 17 |
+
"data_format",
|
| 18 |
+
"input_data_format",
|
| 19 |
+
"device",
|
| 20 |
+
"min_pixels",
|
| 21 |
+
"max_pixels",
|
| 22 |
+
"patch_size",
|
| 23 |
+
"temporal_patch_size",
|
| 24 |
+
"merge_size"
|
| 25 |
+
],
|
| 26 |
+
"crop_size": null,
|
| 27 |
+
"data_format": "channels_first",
|
| 28 |
+
"default_to_square": true,
|
| 29 |
+
"device": null,
|
| 30 |
+
"do_center_crop": null,
|
| 31 |
+
"do_convert_rgb": true,
|
| 32 |
+
"do_normalize": true,
|
| 33 |
+
"do_pad": null,
|
| 34 |
+
"do_rescale": true,
|
| 35 |
+
"do_resize": true,
|
| 36 |
+
"image_mean": [
|
| 37 |
+
0.48145466,
|
| 38 |
+
0.4578275,
|
| 39 |
+
0.40821073
|
| 40 |
+
],
|
| 41 |
+
"image_processor_type": "Qwen2VLImageProcessor",
|
| 42 |
+
"image_std": [
|
| 43 |
+
0.26862954,
|
| 44 |
+
0.26130258,
|
| 45 |
+
0.27577711
|
| 46 |
+
],
|
| 47 |
+
"input_data_format": null,
|
| 48 |
+
"max_pixels": 12845056,
|
| 49 |
+
"merge_size": 2,
|
| 50 |
+
"min_pixels": 3136,
|
| 51 |
+
"model_valid_processing_keys": [
|
| 52 |
+
"do_convert_rgb",
|
| 53 |
+
"do_resize",
|
| 54 |
+
"size",
|
| 55 |
+
"size_divisor",
|
| 56 |
+
"default_to_square",
|
| 57 |
+
"resample",
|
| 58 |
+
"do_rescale",
|
| 59 |
+
"rescale_factor",
|
| 60 |
+
"do_normalize",
|
| 61 |
+
"image_mean",
|
| 62 |
+
"image_std",
|
| 63 |
+
"do_pad",
|
| 64 |
+
"do_center_crop",
|
| 65 |
+
"crop_size",
|
| 66 |
+
"data_format",
|
| 67 |
+
"input_data_format",
|
| 68 |
+
"device",
|
| 69 |
+
"min_pixels",
|
| 70 |
+
"max_pixels",
|
| 71 |
+
"patch_size",
|
| 72 |
+
"temporal_patch_size",
|
| 73 |
+
"merge_size"
|
| 74 |
+
],
|
| 75 |
+
"patch_size": 14,
|
| 76 |
+
"processor_class": "Qwen2_5_VLProcessor",
|
| 77 |
+
"resample": 3,
|
| 78 |
+
"rescale_factor": 0.00392156862745098,
|
| 79 |
+
"size": {
|
| 80 |
+
"longest_edge": 12845056,
|
| 81 |
+
"shortest_edge": 3136
|
| 82 |
+
},
|
| 83 |
+
"size_divisor": null,
|
| 84 |
+
"temporal_patch_size": 2,
|
| 85 |
+
"video_processor_type": "Qwen2VLVideoProcessor"
|
| 86 |
+
}
|