Downloads · 30 days
122
8% of all-time downloads
kyo-takano/open-calm-7b-8bit
open-calm-7b-8bit is a text generation model from kyo-takano. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as cc-by-sa-4.0.
[](https://colab.research.google.com/gist/kyo-takano/0c7bf0479158aa137e0ba935dec70461/opencalm-7b-8bit.ipynb)
Downloads · 30 days
122
8% of all-time downloads
All-time downloads
1.5K
Public
Repo size
14.9 GB
Likes
10
Public
Click a slice to open those files.
.bin7.4 GB · 100%
From the Hugging Face model README
8-bit quantized version of OpenCALM-7B by CyberAgent (under CC BY-SA 4.0)
When using this quantized model, please be sure to give credit to the original.
pip install -q -U bitsandbytes
pip install -q -U git+https://github.com/huggingface/transformers.git
pip install -q -U git+https://github.com/huggingface/accelerate.git
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
MODEL_ID = "kyo-takano/open-calm-7b-8bit"
model = AutoModelForCausalLM.from_pretrained(MODEL_ID)
tokenizer = AutoTokenizer.from_pretrained(MODEL_ID)
inputs = tokenizer("AIによって私達の暮らしは、", return_tensors="pt").to(model.device)
with torch.no_grad():
tokens = model.generate(
**inputs,
max_new_tokens=64,
do_sample=True,
temperature=0.7,
top_p=0.9,
repetition_penalty=1.05,
pad_token_id=tokenizer.pad_token_id,
)
output = tokenizer.decode(tokens[0], skip_special_tokens=True)
print(output)