Instructions to use echo840/Monkey with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use echo840/Monkey with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="echo840/Monkey", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("echo840/Monkey", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use echo840/Monkey with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "echo840/Monkey" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "echo840/Monkey", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/echo840/Monkey
- SGLang
How to use echo840/Monkey 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 "echo840/Monkey" \ --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": "echo840/Monkey", "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 "echo840/Monkey" \ --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": "echo840/Monkey", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use echo840/Monkey with Docker Model Runner:
docker model run hf.co/echo840/Monkey
v1.0
Browse files- config.json +49 -0
- generation_config.json +11 -0
- pytorch_model.bin +3 -0
- qwen.tiktoken +0 -0
- special_tokens_map.json +3 -0
- tokenizer_config.json +14 -0
config.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"MonkeyLMHeadModel"
|
| 4 |
+
],
|
| 5 |
+
"attn_dropout_prob": 0.0,
|
| 6 |
+
"auto_map": {
|
| 7 |
+
"AutoConfig": "configuration_qwen.QWenConfig",
|
| 8 |
+
"AutoModelForCausalLM": "modeling_monkey.MonkeyLMHeadModel"
|
| 9 |
+
},
|
| 10 |
+
"bf16": true,
|
| 11 |
+
"emb_dropout_prob": 0.0,
|
| 12 |
+
"fp16": false,
|
| 13 |
+
"fp32": false,
|
| 14 |
+
"hidden_size": 4096,
|
| 15 |
+
"initializer_range": 0.02,
|
| 16 |
+
"intermediate_size": 22016,
|
| 17 |
+
"kv_channels": 128,
|
| 18 |
+
"layer_norm_epsilon": 1e-06,
|
| 19 |
+
"max_position_embeddings": 8192,
|
| 20 |
+
"model_type": "monkey",
|
| 21 |
+
"no_bias": true,
|
| 22 |
+
"num_attention_heads": 32,
|
| 23 |
+
"num_hidden_layers": 32,
|
| 24 |
+
"onnx_safe": null,
|
| 25 |
+
"rotary_emb_base": 10000,
|
| 26 |
+
"rotary_pct": 1.0,
|
| 27 |
+
"scale_attn_weights": true,
|
| 28 |
+
"seq_length": 2048,
|
| 29 |
+
"tie_word_embeddings": false,
|
| 30 |
+
"tokenizer_type": "QWenTokenizer",
|
| 31 |
+
"torch_dtype": "bfloat16",
|
| 32 |
+
"transformers_version": "4.32.0",
|
| 33 |
+
"use_cache": false,
|
| 34 |
+
"use_dynamic_ntk": true,
|
| 35 |
+
"use_flash_attn": false,
|
| 36 |
+
"use_logn_attn": true,
|
| 37 |
+
"visual": {
|
| 38 |
+
"heads": 16,
|
| 39 |
+
"image_size": 896,
|
| 40 |
+
"image_start_id": 151857,
|
| 41 |
+
"layers": 48,
|
| 42 |
+
"mlp_ratio": 4.9231,
|
| 43 |
+
"output_dim": 4096,
|
| 44 |
+
"patch_size": 14,
|
| 45 |
+
"width": 1664,
|
| 46 |
+
"lora_repeat_num":4
|
| 47 |
+
},
|
| 48 |
+
"vocab_size": 151936
|
| 49 |
+
}
|
generation_config.json
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"chat_format": "raw",
|
| 3 |
+
"do_sample": true,
|
| 4 |
+
"eos_token_id": 151643,
|
| 5 |
+
"max_new_tokens": 512,
|
| 6 |
+
"max_window_size": 6144,
|
| 7 |
+
"pad_token_id": 151643,
|
| 8 |
+
"top_k": 0,
|
| 9 |
+
"top_p": 0.5,
|
| 10 |
+
"transformers_version": "4.32.0"
|
| 11 |
+
}
|
pytorch_model.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:38daaadf5a144d796e21d14ebbae47ead9f908fb70b431cc439d4a335a141a19
|
| 3 |
+
size 19416653673
|
qwen.tiktoken
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"pad_token": "<|endoftext|>"
|
| 3 |
+
}
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"auto_map": {
|
| 3 |
+
"AutoTokenizer": [
|
| 4 |
+
"tokenization_qwen.QWenTokenizer",
|
| 5 |
+
null
|
| 6 |
+
]
|
| 7 |
+
},
|
| 8 |
+
"clean_up_tokenization_spaces": true,
|
| 9 |
+
"model_max_length": 2048,
|
| 10 |
+
"padding_side": "right",
|
| 11 |
+
"tokenizer_class": "QWenTokenizer",
|
| 12 |
+
"trust_remote_code": true,
|
| 13 |
+
"use_fast": false
|
| 14 |
+
}
|