Views
No views yet
rinna/youri-7b-gptq
rinna/youri-7b-gptq is the quantized model for rinna/youri-7b using AutoGPTQ. The quantized version is 4x smaller than the original model and thus requires less memory and provides faster inference.1import torch
2from transformers import AutoTokenizer
3from auto_gptq import AutoGPTQForCausalLM
4
5tokenizer = AutoTokenizer.from_pretrained("rinna/youri-7b-gptq")
6model = AutoGPTQForCausalLM.from_quantized("rinna/youri-7b-gptq", use_safetensors=True)
7
8text = "西田幾多郎は、"
9token_ids = tokenizer.encode(text, add_special_tokens=False, return_tensors="pt")
10
11with torch.no_grad():
12 output_ids = model.generate(
13 input_ids=token_ids.to(model.device),
14 max_new_tokens=200,
15 min_new_tokens=200,
16 do_sample=True,
17 temperature=1.0,
18 top_p=0.95,
19 pad_token_id=tokenizer.pad_token_id,
20 bos_token_id=tokenizer.bos_token_id,
21 eos_token_id=tokenizer.eos_token_id
22 )
23
24output = tokenizer.decode(output_ids.tolist()[0])
25print(output)1@misc{rinna-youri-7b-gptq,
2 title = {rinna/youri-7b-gptq},
3 author = {Wakatsuki, Toshiaki and Zhao, Tianyu and Sawada, Kei},
4 url = {https://huggingface.co/rinna/youri-7b-gptq}
5}
6
7@inproceedings{sawada2024release,
8 title = {Release of Pre-Trained Models for the {J}apanese Language},
9 author = {Sawada, Kei and Zhao, Tianyu and Shing, Makoto and Mitsui, Kentaro and Kaga, Akio and Hono, Yukiya and Wakatsuki, Toshiaki and Mitsuda, Koh},
10 booktitle = {Proceedings of the 2024 Joint International Conference on Computational Linguistics, Language Resources and Evaluation (LREC-COLING 2024)},
11 month = {5},
12 year = {2024},
13 pages = {13898--13905},
14 url = {https://aclanthology.org/2024.lrec-main.1213},
15 note = {\url{https://arxiv.org/abs/2404.01657}}
16}