Text Generation
Transformers
Safetensors
GGUF
Japanese
gemma2
conversational
text-generation-inference
imatrix
How to use from the
Use from the
Transformers library
# Use a pipeline as a high-level helper
from transformers import pipeline

pipe = pipeline("text-generation", model="kajuma/gemma-2-27b-instruct")
messages = [
    {"role": "user", "content": "Who are you?"},
]
pipe(messages)
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM

tokenizer = AutoTokenizer.from_pretrained("kajuma/gemma-2-27b-instruct")
model = AutoModelForCausalLM.from_pretrained("kajuma/gemma-2-27b-instruct")
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]:]))
Quick Links

このモデルはコンペティションのために開発されたモデルです。

推論方法

まず、llama-cpp-pythonをインストールしてください。 その後推論用ライブラリをセットアップします。

git clone https://github.com/weak-kajuma/inference-for-llm-class.git
cd inference-for-llm-class
pip install datasets

次に、モデルをダウンロードします。

# GPUによって量子化サイズや次のセクションの`--ngl`を選んでください。
wget https://huggingface.co/kajuma/gemma-2-27b-instruct/resolve/main/Gemma-2-27B-Instruct_Q6_K.gguf

推論プログラムを実行します。

python answer_llama_cpp.py --model Gemma-2-27B-Instruct_Q6_K.gguf --ngl 46 --data_file data.jsonl

ただしdata.jsonlのフォーマットは以下の通りです。

{"task_id": 0, "input": "質問"}

推論後output.jsonlが作成されます。

Downloads last month
52
Safetensors
Model size
27B params
Tensor type
BF16
·
Inference Providers NEW
Input a message to start chatting with kajuma/gemma-2-27b-instruct.

Model tree for kajuma/gemma-2-27b-instruct

Quantized
(14)
this model

Datasets used to train kajuma/gemma-2-27b-instruct