Instructions to use HuggingFaceM4/tiny-random-idefics with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use HuggingFaceM4/tiny-random-idefics with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="HuggingFaceM4/tiny-random-idefics")# Load model directly from transformers import AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("HuggingFaceM4/tiny-random-idefics") model = AutoModelForImageTextToText.from_pretrained("HuggingFaceM4/tiny-random-idefics") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use HuggingFaceM4/tiny-random-idefics with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "HuggingFaceM4/tiny-random-idefics" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "HuggingFaceM4/tiny-random-idefics", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/HuggingFaceM4/tiny-random-idefics
- SGLang
How to use HuggingFaceM4/tiny-random-idefics 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 "HuggingFaceM4/tiny-random-idefics" \ --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": "HuggingFaceM4/tiny-random-idefics", "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 "HuggingFaceM4/tiny-random-idefics" \ --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": "HuggingFaceM4/tiny-random-idefics", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use HuggingFaceM4/tiny-random-idefics with Docker Model Runner:
docker model run hf.co/HuggingFaceM4/tiny-random-idefics
Upload tokenizer
Browse files- added_tokens.json +0 -1
- special_tokens_map.json +12 -18
- tokenizer.json +0 -0
- tokenizer_config.json +51 -27
added_tokens.json
CHANGED
|
@@ -1,4 +1,3 @@
|
|
| 1 |
{
|
| 2 |
-
"<fake_token_around_image>": 32000,
|
| 3 |
"<image>": 32001
|
| 4 |
}
|
|
|
|
| 1 |
{
|
|
|
|
| 2 |
"<image>": 32001
|
| 3 |
}
|
special_tokens_map.json
CHANGED
|
@@ -1,39 +1,33 @@
|
|
| 1 |
{
|
| 2 |
"additional_special_tokens": [
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
"lstrip": false,
|
| 6 |
-
"normalized": true,
|
| 7 |
-
"rstrip": false,
|
| 8 |
-
"single_word": false
|
| 9 |
-
},
|
| 10 |
-
{
|
| 11 |
-
"content": "<image>",
|
| 12 |
-
"lstrip": false,
|
| 13 |
-
"normalized": true,
|
| 14 |
-
"rstrip": false,
|
| 15 |
-
"single_word": false
|
| 16 |
-
}
|
| 17 |
],
|
| 18 |
"bos_token": {
|
| 19 |
"content": "<s>",
|
| 20 |
"lstrip": false,
|
| 21 |
-
"normalized":
|
| 22 |
"rstrip": false,
|
| 23 |
"single_word": false
|
| 24 |
},
|
| 25 |
"eos_token": {
|
| 26 |
"content": "</s>",
|
| 27 |
"lstrip": false,
|
| 28 |
-
"normalized":
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
"rstrip": false,
|
| 30 |
"single_word": false
|
| 31 |
},
|
| 32 |
-
"pad_token": "<unk>",
|
| 33 |
"unk_token": {
|
| 34 |
"content": "<unk>",
|
| 35 |
"lstrip": false,
|
| 36 |
-
"normalized":
|
| 37 |
"rstrip": false,
|
| 38 |
"single_word": false
|
| 39 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"additional_special_tokens": [
|
| 3 |
+
"<fake_token_around_image>",
|
| 4 |
+
"<image>"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
],
|
| 6 |
"bos_token": {
|
| 7 |
"content": "<s>",
|
| 8 |
"lstrip": false,
|
| 9 |
+
"normalized": false,
|
| 10 |
"rstrip": false,
|
| 11 |
"single_word": false
|
| 12 |
},
|
| 13 |
"eos_token": {
|
| 14 |
"content": "</s>",
|
| 15 |
"lstrip": false,
|
| 16 |
+
"normalized": false,
|
| 17 |
+
"rstrip": false,
|
| 18 |
+
"single_word": false
|
| 19 |
+
},
|
| 20 |
+
"pad_token": {
|
| 21 |
+
"content": "<unk>",
|
| 22 |
+
"lstrip": false,
|
| 23 |
+
"normalized": false,
|
| 24 |
"rstrip": false,
|
| 25 |
"single_word": false
|
| 26 |
},
|
|
|
|
| 27 |
"unk_token": {
|
| 28 |
"content": "<unk>",
|
| 29 |
"lstrip": false,
|
| 30 |
+
"normalized": false,
|
| 31 |
"rstrip": false,
|
| 32 |
"single_word": false
|
| 33 |
}
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
CHANGED
|
@@ -1,35 +1,59 @@
|
|
| 1 |
{
|
| 2 |
-
"
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
"clean_up_tokenization_spaces": false,
|
| 13 |
-
"eos_token":
|
| 14 |
-
"__type": "AddedToken",
|
| 15 |
-
"content": "</s>",
|
| 16 |
-
"lstrip": false,
|
| 17 |
-
"normalized": true,
|
| 18 |
-
"rstrip": false,
|
| 19 |
-
"single_word": false
|
| 20 |
-
},
|
| 21 |
"legacy": true,
|
| 22 |
"model_max_length": 2048,
|
| 23 |
-
"pad_token":
|
| 24 |
"sp_model_kwargs": {},
|
| 25 |
-
"
|
| 26 |
"tokenizer_class": "LlamaTokenizer",
|
| 27 |
-
"unk_token":
|
| 28 |
-
|
| 29 |
-
"content": "<unk>",
|
| 30 |
-
"lstrip": false,
|
| 31 |
-
"normalized": true,
|
| 32 |
-
"rstrip": false,
|
| 33 |
-
"single_word": false
|
| 34 |
-
}
|
| 35 |
}
|
|
|
|
| 1 |
{
|
| 2 |
+
"added_tokens_decoder": {
|
| 3 |
+
"0": {
|
| 4 |
+
"content": "<unk>",
|
| 5 |
+
"lstrip": false,
|
| 6 |
+
"normalized": false,
|
| 7 |
+
"rstrip": false,
|
| 8 |
+
"single_word": false,
|
| 9 |
+
"special": true
|
| 10 |
+
},
|
| 11 |
+
"1": {
|
| 12 |
+
"content": "<s>",
|
| 13 |
+
"lstrip": false,
|
| 14 |
+
"normalized": false,
|
| 15 |
+
"rstrip": false,
|
| 16 |
+
"single_word": false,
|
| 17 |
+
"special": true
|
| 18 |
+
},
|
| 19 |
+
"2": {
|
| 20 |
+
"content": "</s>",
|
| 21 |
+
"lstrip": false,
|
| 22 |
+
"normalized": false,
|
| 23 |
+
"rstrip": false,
|
| 24 |
+
"single_word": false,
|
| 25 |
+
"special": true
|
| 26 |
+
},
|
| 27 |
+
"32000": {
|
| 28 |
+
"content": "<fake_token_around_image>",
|
| 29 |
+
"lstrip": false,
|
| 30 |
+
"normalized": false,
|
| 31 |
+
"rstrip": false,
|
| 32 |
+
"single_word": false,
|
| 33 |
+
"special": true
|
| 34 |
+
},
|
| 35 |
+
"32001": {
|
| 36 |
+
"content": "<image>",
|
| 37 |
+
"lstrip": false,
|
| 38 |
+
"normalized": false,
|
| 39 |
+
"rstrip": false,
|
| 40 |
+
"single_word": false,
|
| 41 |
+
"special": true
|
| 42 |
+
}
|
| 43 |
},
|
| 44 |
+
"additional_special_tokens": [
|
| 45 |
+
"<fake_token_around_image>",
|
| 46 |
+
"<image>"
|
| 47 |
+
],
|
| 48 |
+
"bos_token": "<s>",
|
| 49 |
"clean_up_tokenization_spaces": false,
|
| 50 |
+
"eos_token": "</s>",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 51 |
"legacy": true,
|
| 52 |
"model_max_length": 2048,
|
| 53 |
+
"pad_token": "<unk>",
|
| 54 |
"sp_model_kwargs": {},
|
| 55 |
+
"spaces_between_special_tokens": false,
|
| 56 |
"tokenizer_class": "LlamaTokenizer",
|
| 57 |
+
"unk_token": "<unk>",
|
| 58 |
+
"use_default_system_prompt": true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
}
|