Downloads · 30 days
82
9% of all-time downloads
seonglae/yokhal-md
yokhal-md is a text generation model from seonglae. Use it when you need the model to write or continue text. It is set up for transformers.
Downloads · 30 days
82
9% of all-time downloads
All-time downloads
935
Public
Parameters
2.5B
95.4 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors5 GB · 100%
From the Hugging Face model README
Korean Chatbot based on Google Gemma
Korean Chatbot with Internet culture
Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
Use the code below to get started with the model.
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.bfloat16,
device_map="auto" if device is None else device,
attn_implementation="flash_attention_2") # if flash enabled
sys_prompt = '한국어로 대답해'
texts = ['안녕', '서울은 오늘 어때']
chats = list(map(lambda t: [{'role': 'user', 'content': f'{sys_prompt}\n{t}'}], texts)) # ChatML format
prompts = list(map(lambda p: tokenizer.apply_chat_template(p, tokenize=False, add_generation_prompt=True), chats))
input_ids = tokenizer(prompts, return_tensors="pt", padding=True).to("cuda" if device is None else device)
outputs = model.generate(**input_ids, max_new_tokens=100, repetition_penalty=1.05)
for output in outputs:
print(tokenizer.decode(output, skip_special_tokens=True), end='\n\n')
Trained on 2 x RTX3090
More Information on Github source code
[More Information Needed]
seq_length 1024 with dataset packingbatch 3 per devicelr 1e-5optim adafactorseq_length 2048lr 2e-4Gemma do not support explicit system prompt in ChatML, so I trained putting system prompt before user message like below
if (chat[0]['role'] == 'system'):
chat[1]['content'] = f"{chat[0]['content']}\n{chat[1]['content']}"
chat = chat[1:]
try:
prompt = tokenizer.apply_chat_template(chat, tokenize=False)
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]