Text Generation
Transformers
PyTorch
Indonesian
English
mistral
conversational
text-generation-inference
Instructions to use Ichsan2895/Merak-7B-v4 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Ichsan2895/Merak-7B-v4 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Ichsan2895/Merak-7B-v4") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Ichsan2895/Merak-7B-v4") model = AutoModelForCausalLM.from_pretrained("Ichsan2895/Merak-7B-v4") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Ichsan2895/Merak-7B-v4 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Ichsan2895/Merak-7B-v4" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Ichsan2895/Merak-7B-v4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Ichsan2895/Merak-7B-v4
- SGLang
How to use Ichsan2895/Merak-7B-v4 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 "Ichsan2895/Merak-7B-v4" \ --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": "Ichsan2895/Merak-7B-v4", "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 "Ichsan2895/Merak-7B-v4" \ --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": "Ichsan2895/Merak-7B-v4", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Ichsan2895/Merak-7B-v4 with Docker Model Runner:
docker model run hf.co/Ichsan2895/Merak-7B-v4
Commit ·
0a95b34
1
Parent(s): bf9c193
Update tokenizer_config.json
Browse files- tokenizer_config.json +3 -5
tokenizer_config.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
{
|
| 2 |
"add_bos_token": true,
|
| 3 |
-
"add_eos_token":
|
| 4 |
"added_tokens_decoder": {
|
| 5 |
"0": {
|
| 6 |
"content": "<unk>",
|
|
@@ -53,15 +53,13 @@
|
|
| 53 |
"bos_token": "<s>",
|
| 54 |
"chat_template": "{% if not add_generation_prompt is defined %}{% set add_generation_prompt = false %}{% endif %}{% for message in messages %}{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant\n' }}{% endif %}",
|
| 55 |
"clean_up_tokenization_spaces": false,
|
| 56 |
-
"eos_token": "<
|
| 57 |
"legacy": true,
|
| 58 |
"model_max_length": 1000000000000000019884624838656,
|
| 59 |
"pad_token": "</s>",
|
| 60 |
"sp_model_kwargs": {},
|
| 61 |
"spaces_between_special_tokens": false,
|
| 62 |
"tokenizer_class": "LlamaTokenizer",
|
| 63 |
-
"trust_remote_code": false,
|
| 64 |
"unk_token": "<unk>",
|
| 65 |
-
"use_default_system_prompt": true
|
| 66 |
-
"use_fast": true
|
| 67 |
}
|
|
|
|
| 1 |
{
|
| 2 |
"add_bos_token": true,
|
| 3 |
+
"add_eos_token": false,
|
| 4 |
"added_tokens_decoder": {
|
| 5 |
"0": {
|
| 6 |
"content": "<unk>",
|
|
|
|
| 53 |
"bos_token": "<s>",
|
| 54 |
"chat_template": "{% if not add_generation_prompt is defined %}{% set add_generation_prompt = false %}{% endif %}{% for message in messages %}{{'<|im_start|>' + message['role'] + '\n' + message['content'] + '<|im_end|>' + '\n'}}{% endfor %}{% if add_generation_prompt %}{{ '<|im_start|>assistant\n' }}{% endif %}",
|
| 55 |
"clean_up_tokenization_spaces": false,
|
| 56 |
+
"eos_token": "</s>",
|
| 57 |
"legacy": true,
|
| 58 |
"model_max_length": 1000000000000000019884624838656,
|
| 59 |
"pad_token": "</s>",
|
| 60 |
"sp_model_kwargs": {},
|
| 61 |
"spaces_between_special_tokens": false,
|
| 62 |
"tokenizer_class": "LlamaTokenizer",
|
|
|
|
| 63 |
"unk_token": "<unk>",
|
| 64 |
+
"use_default_system_prompt": true
|
|
|
|
| 65 |
}
|