Downloads · 30 days
13
10% of all-time downloads
Bhavin1905/Gemma-model-fine-tuned-for-advertisement-generation
Gemma-model-fine-tuned-for-advertisement-generation is a text generation model from Bhavin1905. Use it when you need the model to write or continue text. It is set up for transformers.
This is a fine-tuned language model specifically trained for generating creative advertisement scripts and compelling call-to-actions. The model is part of the PromoGen project - an AI-powered advertisement generator.
Downloads · 30 days
13
10% of all-time downloads
All-time downloads
129
Public
Parameters
2.5B
5.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors5 GB · 99%
From the Hugging Face model README
This is a fine-tuned language model specifically trained for generating creative advertisement scripts and compelling call-to-actions. The model is part of the PromoGen project - an AI-powered advertisement generator.
from transformers import AutoTokenizer, AutoModelForCausalLM
import torch
# Load model and tokenizer
tokenizer = AutoTokenizer.from_pretrained("Bhavin1905/Promogen-finetuned-model")
model = AutoModelForCausalLM.from_pretrained("Bhavin1905/Promogen-finetuned-model")
# Set device
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model.to(device)
# Generate advertisement
def generate_ad(company_name, product_name, description):
prompt = f"Company: {company_name}\nProduct: {product_name}\nDescription: {description}\nAdvertisement:"
inputs = tokenizer.encode(prompt, return_tensors="pt").to(device)
with torch.no_grad():
outputs = model.generate(
inputs,
max_new_tokens=100,
temperature=0.8,
top_p=0.85,
do_sample=True,
pad_token_id=tokenizer.eos_token_id
)
generated_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
return generated_text.split("Advertisement:")[-1].strip()
# Example usage
ad_script = generate_ad(
company_name="TechCorp",
product_name="SmartWatch Pro",
description="Advanced fitness tracking with heart rate monitoring"
)
print(ad_script)
This model is designed to work with the PromoGen Flask web application. To use it:
Clone the PromoGen repository:
git clone https://github.com/cptghostriley/PromoGen.git
cd PromoGen
Download this model:
from huggingface_hub import snapshot_download
snapshot_download(
repo_id='Bhavin1905/Promogen-finetuned-model',
local_dir='./promogen_final_model'
)
Run the application:
pip install -r requirements.txt
python app.py
config.json: Model configurationgeneration_config.json: Generation parametersmodel-00001-of-00002.safetensors: Model weights (part 1)model-00002-of-00002.safetensors: Model weights (part 2)model.safetensors.index.json: Model indexspecial_tokens_map.json: Special tokens mappingtokenizer.json: Tokenizer configurationtokenizer.model: Tokenizer model filetokenizer_config.json: Tokenizer configurationIf you use this model in your research or applications, please cite:
@misc{promogen2024,
title={PromoGen: AI-Powered Advertisement Generator},
author={Ashwin Mahawar, Bhavin, and Team PromoGen},
year={2024},
url={https://github.com/cptghostriley/PromoGen}
}
For questions, issues, or collaboration:
Note: This model is part of the PromoGen project and is designed for educational and research purposes. Please ensure compliance with applicable laws and regulations when using for commercial purposes.