Edit model card

Bloom 7B1 LightNovel ZH_CN LoRa Finetuned

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 (?)

Model Details

I just downloaded 50 LightNovels then finetuned the model on raw text.

Trained by Rorical

Use

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))
Downloads last month
2
Inference Examples
This model does not have enough activity to be deployed to Inference API (serverless) yet. Increase its social visibility and check back later, or deploy to Inference Endpoints (dedicated) instead.