Instructions to use robinsyihab/Sidrap-7B-v2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use robinsyihab/Sidrap-7B-v2 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="robinsyihab/Sidrap-7B-v2")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("robinsyihab/Sidrap-7B-v2") model = AutoModelForCausalLM.from_pretrained("robinsyihab/Sidrap-7B-v2") - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use robinsyihab/Sidrap-7B-v2 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "robinsyihab/Sidrap-7B-v2" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "robinsyihab/Sidrap-7B-v2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/robinsyihab/Sidrap-7B-v2
- SGLang
How to use robinsyihab/Sidrap-7B-v2 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 "robinsyihab/Sidrap-7B-v2" \ --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": "robinsyihab/Sidrap-7B-v2", "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 "robinsyihab/Sidrap-7B-v2" \ --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": "robinsyihab/Sidrap-7B-v2", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use robinsyihab/Sidrap-7B-v2 with Docker Model Runner:
docker model run hf.co/robinsyihab/Sidrap-7B-v2
LLM Model for Bahasa Indonesia Dialog
Sidrap-7B-v2 is one of the best open model LLM bahasa Indonesia available today.
This model is fine-tuned using a carefully curated and high-quality Bahasa Indonesia dataset and employs Sidrap-7B-v1 as the base model.
For 4-bit quantization, please take a look at Sidrap-7B-v2-GPTQ-4bit
Usage
from transformers import AutoModelForCausalLM, AutoTokenizer
device = "cuda" # the device to load the model onto
model = AutoModelForCausalLM.from_pretrained("robinsyihab/Sidrap-7B-v2")
tokenizer = AutoTokenizer.from_pretrained("robinsyihab/Sidrap-7B-v2")
messages = [
{"role": "system", "content": "Anda adalah asisten yang suka membantu, penuh hormat, dan jujur. Selalu jawab semaksimal mungkin, sambil tetap aman. Jawaban Anda tidak boleh berisi konten berbahaya, tidak etis, rasis, seksis, beracun, atau ilegal. Harap pastikan bahwa tanggapan Anda tidak memihak secara sosial dan bersifat positif.\n\
Jika sebuah pertanyaan tidak masuk akal, atau tidak koheren secara faktual, jelaskan alasannya daripada menjawab sesuatu yang tidak benar. Jika Anda tidak mengetahui jawaban atas sebuah pertanyaan, mohon jangan membagikan informasi palsu."},
{"role": "user", "content": "buatkan kode program, sebuah fungsi untuk memvalidasi alamat email menggunakan regex"}
]
encodeds = tokenizer.apply_chat_template(messages, return_tensors="pt")
model_inputs = encodeds.to(device)
model.to(device)
generated_ids = model.generate(model_inputs, max_new_tokens=1000, do_sample=True)
decoded = tokenizer.batch_decode(generated_ids)
print(decoded[0])
NOTES: To achieve optimal results in Bahasa Indonesia, please use a system message as the initial input as demonstrated above.
Limitations and Ethical Considerations
The Sidrap-7B-v2 model, trained mostly on a public dataset, lacks a moderation mechanism, please use with caution.
It may still have limitations and biases. It is always recommended to review and evaluate the generated outputs for any potential issues.
We're looking forward to engaging with the community on ways to make the model finely respect guardrails, allowing for deployment in environments requiring moderated outputs.
Furthermore, please ensure that the usage of this language model is aligned with ethical guidelines, respectful of privacy, and avoids harmful content generation.
Citation
If you use the Sidrap-7B-v2 model in your research or project, please cite it as:
@article{Sidrap,
title={Sidrap-7B-v2: LLM Model for Bahasa Indonesia Dialog},
author={Robin Syihab},
publisher={Hugging Face}
journal={Hugging Face Repository},
year={2023}
}
- Downloads last month
- 758