Downloads · 30 days
24
0% of all-time downloads
shahp7575/gpt2-horoscopes
gpt2-horoscopes is a text generation model from shahp7575. Use it when you need the model to write or continue text. It is set up for transformers.
[](https://share.streamlit.io/shahp7575/gpt2-horoscopes-app/generate.py)
Downloads · 30 days
24
0% of all-time downloads
All-time downloads
29K
Public
Repo size
1 GB
Likes
1
Public
Click a slice to open those files.
.bin510 MB · 100%
From the Hugging Face model README
GPT2 fine-tuned on Horoscopes dataset scraped from Horoscopes.com. This model generates horoscopes given a horoscope category.
The model can be used directly with the HuggingFace pipeline API.
from transformers import AutoTokenizer, AutoModelWithLMHead
tokenizer = AutoTokenizer.from_pretrained("shahp7575/gpt2-horoscopes")
model = AutoModelWithLMHead.from_pretrained("shahp7575/gpt2-horoscopes")
Input Text Format - <|category|> {category_type} <|horoscope|>
Supported Categories - general, career, love, wellness, birthday
Example:
prompt = <|category|> career <|horoscope|>
prompt_encoded = torch.tensor(tokenizer.encode(prompt)).unsqueeze(0)
sample_outputs = model.generate(prompt,
do_sample=True,
top_k=40,
max_length = 300,
top_p=0.95,
temperature=0.95,
num_return_sequences=1)
For reference this generation script can be used as well.
Dataset is scraped from Horoscopes.com for 5 categories with a total of ~12k horoscopes. The dataset can be found on Kaggle.
The model uses the GPT2 checkpoint and then is fine-tuned on horoscopes dataset for 5 different categories. Since the goal of the fine-tuned model was also to understand different horoscopes for different category types, the categories are added to the training data separated by special token <|category|>.
Training Parameters:
Loss: 2.77
This model is only fine-tuned on horoscopes by categories. They do not, and neither attempt to, represent actual horoscopes. It is developed only for educational and learning purposes.