Downloads · 30 days
6
3% of all-time downloads
Rorical/bloom-7b1-lightnovel-lora
bloom-7b1-lightnovel-lora is a text generation model from Rorical. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as bigscience-bloom-rail-1.0.
BigScience Large Open-science Open-access Multilingual Language Model with 7,1 billion parameters finetuned on Chinese Translation of Japanese LightNovel using LoRa from PEFT (?)
Downloads · 30 days
6
3% of all-time downloads
All-time downloads
196
Public
Repo size
47.2 MB
Likes
3
Public
Click a slice to open those files.
.bin47.2 MB · 100%
From the Hugging Face model README
BigScience Large Open-science Open-access Multilingual Language Model with 7,1 billion parameters finetuned on Chinese Translation of Japanese LightNovel using LoRa from PEFT (?)
I just downloaded 50 LightNovels then finetuned the model on raw text.
Trained by Rorical
import torch
from peft import PeftModel, PeftConfig
from transformers import AutoModelForCausalLM, AutoTokenizer
peft_model_id = "Rorical/bloom-7b1-lightnovel-lora"
config = PeftConfig.from_pretrained(peft_model_id)
model = AutoModelForCausalLM.from_pretrained(config.base_model_name_or_path, return_dict=True, load_in_8bit=True, device_map='auto', cache_dir="cache")
tokenizer = AutoTokenizer.from_pretrained(config.base_model_name_or_path, cache_dir="cache")
model = PeftModel.from_pretrained(model, peft_model_id, cache_dir="cache")
prompt = "你是谁?\n"
batch = tokenizer(prompt, return_tensors='pt').to("cuda")
with torch.cuda.amp.autocast():
output_tokens = model.generate(**batch, max_new_tokens=150, do_sample=True, top_k=50, top_p=0.95)
print(tokenizer.decode(output_tokens[0], skip_special_tokens=True))