Downloads · 30 days
2
4% of all-time downloads
10432mztn/gemma-2-9b-cb-ichikara-it
gemma-2-9b-cb-ichikara-it is a text generation model from 10432mztn. Use it when you need the model to write or continue text. It is set up for transformers.
This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
Downloads · 30 days
2
4% of all-time downloads
All-time downloads
46
Public
Parameters
9.4B
27.9 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors6.5 GB · 99%
How the weights are stored.
U88.3B · 89%
From the Hugging Face model README
This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig
import torch
# Hugging Faceトークンの設定
HF_TOKEN = "あなたのトークン"
# モデルの設定
model_name = "10432mztn/gemma-2-9b-cb-ichikara-it"
commit_hash = "143b6959a349f1b7650a976387bd00c902dc5e7c" # v3
version_name = "v3"
# 4ビット量子化の設定
bnb_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype=torch.bfloat16,
bnb_4bit_use_double_quant=False,
)
# モデルとトークナイザーの読み込み
model = AutoModelForCausalLM.from_pretrained(
model_name,
revision=commit_hash,
quantization_config=bnb_config,
device_map="auto",
token=HF_TOKEN
)
tokenizer = AutoTokenizer.from_pretrained(
model_name,
trust_remote_code=True,
token=HF_TOKEN
)
# 推論用のデータセット読み込み
datasets = []
with open("path/to/your/tasks.jsonl", "r") as f:
item = ""
for line in f:
line = line.strip()
item += line
if item.endswith("}"):
datasets.append(json.loads(item))
item = ""
# 推論の実行
results = []
for data in tqdm(datasets):
input = data["input"]
prompt = f"""### 指示
{input}
### 回答:
"""
input_ids = tokenizer(prompt, return_tensors="pt").to(model.device)
outputs = model.generate(
**input_ids,
max_new_tokens=512,
do_sample=False,
repetition_penalty=1.2,
)
output = tokenizer.decode(outputs[0][input_ids.input_ids.size(1):], skip_special_tokens=True)
results.append({
"task_id": data["task_id"],
"input": input,
"output": output
})
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
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.
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
BibTeX:
[More Information Needed]
APA:
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]
[More Information Needed]