--- library_name: peft base_model: bigscience/bloomz-3b --- # What it is The model generates funky marketing emails, see example below. Implementation: A QLORA fine tuning over a [bigscience/bloomz-3b](https://huggingface.co/bigscience/bloomz-3b), utilizing the [FourthBrainGenAI/MarketMail-AI](https://huggingface.co/datasets/FourthBrainGenAI/MarketMail-AI) dataset with 17 rows. # Inference example ```python import torch from peft import PeftModel, PeftConfig from transformers import AutoModelForCausalLM, AutoTokenizer peft_model_id = "borislitvak/boris-bloomz-peft-marketing" config = PeftConfig.from_pretrained(peft_model_id) model = AutoModelForCausalLM.from_pretrained(config.base_model_name_or_path, return_dict=True, load_in_8bit=False, device_map='auto') tokenizer = AutoTokenizer.from_pretrained(config.base_model_name_or_path) # Load the Lora model model = PeftModel.from_pretrained(model, peft_model_id) from IPython.display import display, Markdown def make_inference(product, description): batch = tokenizer(f"### INSTRUCTION\nBelow is a product and description, please write a marketing email for this product.\n\n### Product:\n{product}\n### Description:\n{description}\n\n### Marketing Email:\n", return_tensors='pt') with torch.cuda.amp.autocast(): output_tokens = model.generate(**batch, max_new_tokens=200) # for Jupyter. If serving in regular Python, remove display/Markdown display(Markdown((tokenizer.decode(output_tokens[0], skip_special_tokens=True)))) your_product_name_here = "" your_product_description_here = "" make_inference(your_product_name_here, your_product_description_here) ```