Instructions to use adept/fuyu-8b with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use adept/fuyu-8b with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="adept/fuyu-8b")# Load model directly from transformers import AutoProcessor, AutoModelForImageTextToText processor = AutoProcessor.from_pretrained("adept/fuyu-8b") model = AutoModelForImageTextToText.from_pretrained("adept/fuyu-8b") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use adept/fuyu-8b with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "adept/fuyu-8b" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "adept/fuyu-8b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/adept/fuyu-8b
- SGLang
How to use adept/fuyu-8b 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 "adept/fuyu-8b" \ --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": "adept/fuyu-8b", "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 "adept/fuyu-8b" \ --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": "adept/fuyu-8b", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use adept/fuyu-8b with Docker Model Runner:
docker model run hf.co/adept/fuyu-8b
Upload processor
#4
by Molbap HF Staff - opened
- preprocessor_config.json +8 -0
- special_tokens_map.json +4 -0
- tokenizer.json +2 -2
- tokenizer_config.json +7 -5
preprocessor_config.json
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"image_processor_type": "FuyuImageProcessor",
|
| 3 |
+
"padding_mode": "constant",
|
| 4 |
+
"padding_value": 1.0,
|
| 5 |
+
"processor_class": "FuyuProcessor",
|
| 6 |
+
"target_height": 1080,
|
| 7 |
+
"target_width": 1920
|
| 8 |
+
}
|
special_tokens_map.json
CHANGED
|
@@ -1,4 +1,8 @@
|
|
| 1 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
"bos_token": "|ENDOFTEXT|",
|
| 3 |
"eos_token": "|ENDOFTEXT|",
|
| 4 |
"unk_token": "<unk>"
|
|
|
|
| 1 |
{
|
| 2 |
+
"additional_special_tokens": [
|
| 3 |
+
"<unk>",
|
| 4 |
+
"|ENDOFTEXT|"
|
| 5 |
+
],
|
| 6 |
"bos_token": "|ENDOFTEXT|",
|
| 7 |
"eos_token": "|ENDOFTEXT|",
|
| 8 |
"unk_token": "<unk>"
|
tokenizer.json
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
-
size
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:20119416a890c3fefc86210999fb8189dde194c12f7f861dbb3bc7a922baaabb
|
| 3 |
+
size 16454569
|
tokenizer_config.json
CHANGED
|
@@ -1,11 +1,9 @@
|
|
| 1 |
{
|
| 2 |
-
"add_bos_token": true,
|
| 3 |
-
"add_eos_token": false,
|
| 4 |
"added_tokens_decoder": {
|
| 5 |
"0": {
|
| 6 |
"content": "<unk>",
|
| 7 |
"lstrip": false,
|
| 8 |
-
"normalized":
|
| 9 |
"rstrip": false,
|
| 10 |
"single_word": false,
|
| 11 |
"special": true
|
|
@@ -13,19 +11,23 @@
|
|
| 13 |
"71013": {
|
| 14 |
"content": "|ENDOFTEXT|",
|
| 15 |
"lstrip": false,
|
| 16 |
-
"normalized":
|
| 17 |
"rstrip": false,
|
| 18 |
"single_word": false,
|
| 19 |
"special": true
|
| 20 |
}
|
| 21 |
},
|
| 22 |
-
"additional_special_tokens": [
|
|
|
|
|
|
|
|
|
|
| 23 |
"bos_token": "|ENDOFTEXT|",
|
| 24 |
"clean_up_tokenization_spaces": false,
|
| 25 |
"eos_token": "|ENDOFTEXT|",
|
| 26 |
"legacy": true,
|
| 27 |
"model_max_length": 1000000000000000019884624838656,
|
| 28 |
"pad_token": null,
|
|
|
|
| 29 |
"sp_model_kwargs": {},
|
| 30 |
"spaces_between_special_tokens": false,
|
| 31 |
"tokenizer_class": "LlamaTokenizer",
|
|
|
|
| 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
|
|
|
|
| 11 |
"71013": {
|
| 12 |
"content": "|ENDOFTEXT|",
|
| 13 |
"lstrip": false,
|
| 14 |
+
"normalized": false,
|
| 15 |
"rstrip": false,
|
| 16 |
"single_word": false,
|
| 17 |
"special": true
|
| 18 |
}
|
| 19 |
},
|
| 20 |
+
"additional_special_tokens": [
|
| 21 |
+
"<unk>",
|
| 22 |
+
"|ENDOFTEXT|"
|
| 23 |
+
],
|
| 24 |
"bos_token": "|ENDOFTEXT|",
|
| 25 |
"clean_up_tokenization_spaces": false,
|
| 26 |
"eos_token": "|ENDOFTEXT|",
|
| 27 |
"legacy": true,
|
| 28 |
"model_max_length": 1000000000000000019884624838656,
|
| 29 |
"pad_token": null,
|
| 30 |
+
"processor_class": "FuyuProcessor",
|
| 31 |
"sp_model_kwargs": {},
|
| 32 |
"spaces_between_special_tokens": false,
|
| 33 |
"tokenizer_class": "LlamaTokenizer",
|