Instructions to use PatrickHaller/hgrn2_de_wiki with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use PatrickHaller/hgrn2_de_wiki with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="PatrickHaller/hgrn2_de_wiki", trust_remote_code=True)# Load model directly from transformers import AutoModelForCausalLM model = AutoModelForCausalLM.from_pretrained("PatrickHaller/hgrn2_de_wiki", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use PatrickHaller/hgrn2_de_wiki with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "PatrickHaller/hgrn2_de_wiki" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "PatrickHaller/hgrn2_de_wiki", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/PatrickHaller/hgrn2_de_wiki
- SGLang
How to use PatrickHaller/hgrn2_de_wiki 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 "PatrickHaller/hgrn2_de_wiki" \ --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": "PatrickHaller/hgrn2_de_wiki", "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 "PatrickHaller/hgrn2_de_wiki" \ --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": "PatrickHaller/hgrn2_de_wiki", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use PatrickHaller/hgrn2_de_wiki with Docker Model Runner:
docker model run hf.co/PatrickHaller/hgrn2_de_wiki
Upload config.json with huggingface_hub
Browse files- config.json +35 -0
config.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"architectures": [
|
| 3 |
+
"HGRN2ForCausalLM"
|
| 4 |
+
],
|
| 5 |
+
"attn_mode": "chunk",
|
| 6 |
+
"bos_token_id": 1,
|
| 7 |
+
"conv_size": 4,
|
| 8 |
+
"elementwise_affine": true,
|
| 9 |
+
"eos_token_id": 2,
|
| 10 |
+
"expand_ratio": 128,
|
| 11 |
+
"fuse_cross_entropy": true,
|
| 12 |
+
"hidden_act": "swish",
|
| 13 |
+
"hidden_ratio": 4,
|
| 14 |
+
"hidden_size": 1024,
|
| 15 |
+
"initializer_range": 0.02,
|
| 16 |
+
"intermediate_size": null,
|
| 17 |
+
"max_position_embeddings": 2048,
|
| 18 |
+
"model_type": "hgrn2",
|
| 19 |
+
"norm_eps": 1e-06,
|
| 20 |
+
"num_heads": null,
|
| 21 |
+
"num_hidden_layers": 26,
|
| 22 |
+
"tie_word_embeddings": false,
|
| 23 |
+
"torch_dtype": "float32",
|
| 24 |
+
"transformers_version": "4.44.1",
|
| 25 |
+
"use_cache": true,
|
| 26 |
+
"use_lower_bound": true,
|
| 27 |
+
"use_short_conv": false,
|
| 28 |
+
"vocab_size": 32000,
|
| 29 |
+
"auto_map": {
|
| 30 |
+
"AutoConfig": "configuration_hgrn2.HGRN2Config",
|
| 31 |
+
"AutoModelForCausalLM": "modeling_hgrn2.HGRN2ForCausalLM",
|
| 32 |
+
"AutoModel": "modeling_hgrn2.HGRN2Model",
|
| 33 |
+
"AutoModelForSequenceClassification": "modeling_hgrn2.HGRN2ForSequenceClassification"
|
| 34 |
+
}
|
| 35 |
+
}
|