Text Generation
Transformers
Safetensors
Thai
English
mistral
conversational
text-generation-inference
Instructions to use Mewband12/seallm-7b-v2-chat-th with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Mewband12/seallm-7b-v2-chat-th with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Mewband12/seallm-7b-v2-chat-th") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Mewband12/seallm-7b-v2-chat-th") model = AutoModelForCausalLM.from_pretrained("Mewband12/seallm-7b-v2-chat-th", device_map="auto") 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]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Mewband12/seallm-7b-v2-chat-th with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Mewband12/seallm-7b-v2-chat-th" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Mewband12/seallm-7b-v2-chat-th", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/Mewband12/seallm-7b-v2-chat-th
- SGLang
How to use Mewband12/seallm-7b-v2-chat-th 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 "Mewband12/seallm-7b-v2-chat-th" \ --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": "Mewband12/seallm-7b-v2-chat-th", "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 "Mewband12/seallm-7b-v2-chat-th" \ --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": "Mewband12/seallm-7b-v2-chat-th", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use Mewband12/seallm-7b-v2-chat-th with Docker Model Runner:
docker model run hf.co/Mewband12/seallm-7b-v2-chat-th
Template
<|im_start|>system
You are a helpful assistant. You will only answer based on provided document if relevant to users question.
<|im_start|>user
คุณจะได้รับรายละเอียดเอกสาร และคำถามจากผู้ใช้ใน ''' ด้านล่าง
'''
DOCUMENT: {reference}
QUESTION: {question}
'''
ตอบคำถาม ใช้รายละเอียดเกี่ยวกับปัญหาทั่วไปจาก DOCUMENT หากคำถามไม่เกี่ยวข้องกับ DOCUMENT ที่ให้ไว้ โปรดตอบเท่านั้น
“ฉันไม่ทราบคำตอบ ไม่ได้เป็นส่วนหนึ่งของเอกสาร DOCUMENT ที่ให้มา”
ห้ามใช้ข้อมูลใดๆ นอกเหนือ DOCUMENT ที่ให้ไว้</s>
<|im_start|>user
QUESTION: {question} </s><|im_start|>assistant
ANSWER: {answer}</s>
| Step | Training Loss | Validation Loss |
|---|---|---|
| 1000 | 0.978900 | 0.980906 |
| 2000 | 0.699000 | 0.612407 |
| 3000 | 0.478000 | 0.490171 |
| 4000 | 0.362000 | 0.437152 |
| 5000 | 0.333700 | 0.413056 |
| 6000 | 0.333200 | 0.393786 |
| 7000 | 0.324200 | 0.379746 |
| 8000 | 0.297500 | 0.372649 |
QLORA FT using thai dataset ~ 4K on RAG instruction. Fine tuned on https://huggingface.co/SeaLLMs/SeaLLM-7B-v2
Purpose: To help LLM avoid to answer what's not in the document better (reduce hallucination for RAG)
- Downloads last month
- 12