Downloads · 30 days
2
9% of all-time downloads
RichardErkhov/hon9kon9ize_-_CantoneseLLMChat-v1.0-7B-8bits
hon9kon9ize_-_CantoneseLLMChat-v1.0-7B-8bits is a machine learning model from RichardErkhov. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Downloads · 30 days
2
9% of all-time downloads
All-time downloads
22
Public
Parameters
7.6B
8.7 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors8.7 GB · 100%
How the weights are stored.
I86.5B · 86%
From the Hugging Face model README
Quantization made by Richard Erkhov.
CantoneseLLMChat-v1.0-7B - bnb 8bits
license: other library_name: transformers tags:

Cantonese LLM Chat v1.0 is the first generation Cantonese LLM from hon9kon9ize. Building upon the sucess of v0.5 preview, the model excels in Hong Kong related specific knowledge and Cantonese conversation.
Base model obtained via Continuous Pre-Training of Qwen 2.5 7B with 600 millions publicaly available Hong Kong news articles and Cantonese websites. Instructions fine-tuned model trained with a dataset consists of 75,000 instrutions pairs. 45,000 pairs were Cantonese insturctions generated by other LLMs and reviewed by humans.
The model trained with 1 Nvidia H100 80GB HBM3 GPU on Genkai Supercomputer.
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
model_id = "hon9kon9ize/CantoneseLLMChat-v1.0-7B"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
torch_dtype=torch.bfloat16,
device_map="auto",
)
def chat(messages, temperature=0.9, max_new_tokens=200):
input_ids = tokenizer.apply_chat_template(conversation=messages, tokenize=True, add_generation_prompt=True, return_tensors='pt').to('cuda:0')
output_ids = model.generate(input_ids, max_new_tokens=max_new_tokens, temperature=temperature)
response = tokenizer.decode(output_ids[0][input_ids.shape[1]:], skip_special_tokens=False)
return response
prompt = "邊個係香港特首?"
messages = [
{"role": "system", "content": "you are a helpful assistant."},
{"role": "user", "content": prompt}
]
print(chat(messages)) # 香港特別行政區行政長官係李家超。<|im_end|>