Instructions to use YanweiLi/MGM-34B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use YanweiLi/MGM-34B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="YanweiLi/MGM-34B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("YanweiLi/MGM-34B", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use YanweiLi/MGM-34B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "YanweiLi/MGM-34B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "YanweiLi/MGM-34B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/YanweiLi/MGM-34B
- SGLang
How to use YanweiLi/MGM-34B 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 "YanweiLi/MGM-34B" \ --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": "YanweiLi/MGM-34B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "YanweiLi/MGM-34B" \ --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": "YanweiLi/MGM-34B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use YanweiLi/MGM-34B with Docker Model Runner:
docker model run hf.co/YanweiLi/MGM-34B
update config
Browse files- config.json +1 -4
config.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
| 1 |
{
|
| 2 |
"_name_or_path": "model_zoo/LLM/Nous-Hermes-2-Yi-34B",
|
| 3 |
"architectures": [
|
| 4 |
-
"
|
| 5 |
],
|
| 6 |
"attention_bias": false,
|
| 7 |
"attention_dropout": 0.0,
|
|
@@ -30,7 +30,6 @@
|
|
| 30 |
"mm_vision_select_layer": -2,
|
| 31 |
"mm_vision_tower": "model_zoo/OpenAI/clip-vit-large-patch14-336",
|
| 32 |
"mm_vision_tower_aux": "model_zoo/OpenAI/openclip-convnext-large-d-320-laion2B-s29B-b131K-ft-soup",
|
| 33 |
-
"model_type": "llava_uni",
|
| 34 |
"num_attention_heads": 56,
|
| 35 |
"num_hidden_layers": 60,
|
| 36 |
"num_key_value_heads": 8,
|
|
@@ -47,10 +46,8 @@
|
|
| 47 |
"torch_dtype": "bfloat16",
|
| 48 |
"transformers_version": "4.36.2",
|
| 49 |
"tune_mm_mlp_adapter": false,
|
| 50 |
-
"unified_resampler": "simple_sum",
|
| 51 |
"use_cache": true,
|
| 52 |
"use_mm_proj": true,
|
| 53 |
-
"use_same_im_pos": false,
|
| 54 |
"video_grid": -1,
|
| 55 |
"vocab_size": 64000
|
| 56 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"_name_or_path": "model_zoo/LLM/Nous-Hermes-2-Yi-34B",
|
| 3 |
"architectures": [
|
| 4 |
+
"MiniGeminiLlamaForCausalLM"
|
| 5 |
],
|
| 6 |
"attention_bias": false,
|
| 7 |
"attention_dropout": 0.0,
|
|
|
|
| 30 |
"mm_vision_select_layer": -2,
|
| 31 |
"mm_vision_tower": "model_zoo/OpenAI/clip-vit-large-patch14-336",
|
| 32 |
"mm_vision_tower_aux": "model_zoo/OpenAI/openclip-convnext-large-d-320-laion2B-s29B-b131K-ft-soup",
|
|
|
|
| 33 |
"num_attention_heads": 56,
|
| 34 |
"num_hidden_layers": 60,
|
| 35 |
"num_key_value_heads": 8,
|
|
|
|
| 46 |
"torch_dtype": "bfloat16",
|
| 47 |
"transformers_version": "4.36.2",
|
| 48 |
"tune_mm_mlp_adapter": false,
|
|
|
|
| 49 |
"use_cache": true,
|
| 50 |
"use_mm_proj": true,
|
|
|
|
| 51 |
"video_grid": -1,
|
| 52 |
"vocab_size": 64000
|
| 53 |
}
|