Instructions to use baffo32/genji-python-6B-split with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use baffo32/genji-python-6B-split with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="baffo32/genji-python-6B-split")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("baffo32/genji-python-6B-split") model = AutoModelForCausalLM.from_pretrained("baffo32/genji-python-6B-split") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use baffo32/genji-python-6B-split with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "baffo32/genji-python-6B-split" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "baffo32/genji-python-6B-split", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/baffo32/genji-python-6B-split
- SGLang
How to use baffo32/genji-python-6B-split 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 "baffo32/genji-python-6B-split" \ --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": "baffo32/genji-python-6B-split", "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 "baffo32/genji-python-6B-split" \ --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": "baffo32/genji-python-6B-split", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use baffo32/genji-python-6B-split with Docker Model Runner:
docker model run hf.co/baffo32/genji-python-6B-split
add alternative config + keys is_split, subfolder
Browse files- config.json +51 -0
- model/config.json +2 -1
config.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"activation_function": "gelu_new",
|
| 3 |
+
"architectures": [
|
| 4 |
+
"GPTNeoForCausalLM"
|
| 5 |
+
],
|
| 6 |
+
"attention_dropout": 0,
|
| 7 |
+
"attention_layers": ["global", "global", "global", "global", "global", "global", "global", "global", "global", "global", "global", "global", "global", "global", "global", "global", "global", "global", "global", "global", "global", "global", "global", "global", "global", "global", "global", "global"],
|
| 8 |
+
"attention_types": [
|
| 9 |
+
[
|
| 10 |
+
[
|
| 11 |
+
"global"
|
| 12 |
+
],
|
| 13 |
+
28
|
| 14 |
+
]
|
| 15 |
+
],
|
| 16 |
+
"bos_token_id": 50256,
|
| 17 |
+
"embed_dropout": 0,
|
| 18 |
+
"eos_token_id": 50256,
|
| 19 |
+
"gradient_checkpointing": false,
|
| 20 |
+
"hidden_size": 4096,
|
| 21 |
+
"initializer_range": 0.02,
|
| 22 |
+
"intermediate_size": null,
|
| 23 |
+
"is_split": true,
|
| 24 |
+
"jax": true,
|
| 25 |
+
"layer_norm_epsilon": 1e-05,
|
| 26 |
+
"max_position_embeddings": 2048,
|
| 27 |
+
"model_type": "gpt_neo",
|
| 28 |
+
"num_heads": 16,
|
| 29 |
+
"num_layers": 28,
|
| 30 |
+
"resid_dropout": 0,
|
| 31 |
+
"rotary": true,
|
| 32 |
+
"rotary_dim": 64,
|
| 33 |
+
"subfolder": "model",
|
| 34 |
+
"summary_activation": null,
|
| 35 |
+
"summary_first_dropout": 0.1,
|
| 36 |
+
"summary_proj_to_labels": true,
|
| 37 |
+
"summary_type": "cls_index",
|
| 38 |
+
"summary_use_proj": true,
|
| 39 |
+
"transformers_version": "4.10.0.dev0",
|
| 40 |
+
"use_cache": true,
|
| 41 |
+
"vocab_size": 50400,
|
| 42 |
+
"window_size": 256,
|
| 43 |
+
"tokenizer_class": "GPT2Tokenizer",
|
| 44 |
+
"task_specific_params": {
|
| 45 |
+
"text-generation": {
|
| 46 |
+
"do_sample": true,
|
| 47 |
+
"temperature": 1.0,
|
| 48 |
+
"max_length": 50
|
| 49 |
+
}
|
| 50 |
+
}
|
| 51 |
+
}
|
model/config.json
CHANGED
|
@@ -20,6 +20,7 @@
|
|
| 20 |
"hidden_size": 4096,
|
| 21 |
"initializer_range": 0.02,
|
| 22 |
"intermediate_size": null,
|
|
|
|
| 23 |
"jax": true,
|
| 24 |
"layer_norm_epsilon": 1e-05,
|
| 25 |
"max_position_embeddings": 2048,
|
|
@@ -46,4 +47,4 @@
|
|
| 46 |
"max_length": 50
|
| 47 |
}
|
| 48 |
}
|
| 49 |
-
}
|
|
|
|
| 20 |
"hidden_size": 4096,
|
| 21 |
"initializer_range": 0.02,
|
| 22 |
"intermediate_size": null,
|
| 23 |
+
"is_split": true,
|
| 24 |
"jax": true,
|
| 25 |
"layer_norm_epsilon": 1e-05,
|
| 26 |
"max_position_embeddings": 2048,
|
|
|
|
| 47 |
"max_length": 50
|
| 48 |
}
|
| 49 |
}
|
| 50 |
+
}
|