Downloads · 30 days
0
RichardErkhov/alfredplpl_-_gemma-2b-it-ja-poc-exl2
alfredplpl_-_gemma-2b-it-ja-poc-exl2 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
0
Access
Public
Updated Jan 18, 2025
Repo size
—
Likes
0
Public
Click a slice to open those files.
.json1 MB · 99%
From the Hugging Face model README
Quantization made by Richard Erkhov.
gemma-2b-it-ja-poc - EXL2
| Branch | Bits | Description |
|---|---|---|
| 8_0 | 8.0 | Maximum quality that ExLlamaV2 can produce, near unquantized performance. |
| 6_5 | 6.5 | Very similar to 8.0, good tradeoff of size vs performance, recommended. |
| 5_0 | 5.0 | Slightly lower quality vs 6.5, but usable |
| 4_25 | 4.25 | GPTQ equivalent bits per weight, slightly higher quality. |
| 3_5 | 3.5 | Lower quality, only use if you have to. |
With git:
git clone --single-branch --branch 6_5 https://huggingface.co/alfredplpl_-_gemma-2b-it-ja-poc-exl2 gemma-2b-it-ja-poc-6_5
With huggingface hub:
pip3 install huggingface-hub
To download a specific branch, use the --revision parameter. For example, to download the 6.5 bpw branch:
Linux:
huggingface-cli download alfredplpl_-_gemma-2b-it-ja-poc-exl2 --revision 6_5 --local-dir gemma-2b-it-ja-poc-6_5 --local-dir-use-symlinks False
Windows (which apparently doesn't like _ in folders sometimes?):
huggingface-cli download alfredplpl_-_gemma-2b-it-ja-poc-exl2 --revision 6_5 --local-dir gemma-2b-it-ja-poc-6.5 --local-dir-use-symlinks False
language:
このモデルはマージに失敗してバグっているため、こちらをおすすめします。
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
# トークナイザーとモデルの準備
tokenizer = AutoTokenizer.from_pretrained(
"alfredplpl/gemma-2b-it-ja-poc"
)
model = AutoModelForCausalLM.from_pretrained(
"alfredplpl/gemma-2b-it-ja-poc"
)
# プロンプトの準備
prompt="""
あなたは親切なアシスタントです。英語は喋らず、日本語だけ喋ってください。
<start_of_turn>user
人生で大切なことはなんですか?<end_of_turn>
<start_of_turn>model"""
# 推論の実行
input_ids = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(
**input_ids,
max_new_tokens=128,
do_sample=True,
top_p=0.95,
temperature=0.2,
repetition_penalty=1.1,
)
print(tokenizer.decode(outputs[0]))
<bos>
あなたは親切なアシスタントです。英語は喋らず、日本語だけ喋ってください。
<start_of_turn>user
人生で大切なことはなんですか?<end_of_turn>
<start_of_turn>model
人生で大切なことはたくさんある。しかし、最も重要なのは、愛する人を大切にし、その人と幸せになることだ。<end_of_turn>
<eos>
<bos>
{{system prompt}}
<start_of_turn>user
{{prompt}}<end_of_turn>
<start_of_turn>model
{{response}}<end_of_turn>
<eos>