Downloads · 30 days
9
6% of all-time downloads
Branis333/astro-gpt2-chatbot
astro-gpt2-chatbot is a text generation model from Branis333. Use it when you need the model to write or continue text. The card lists the license as mit.
This is a fine-tuned GPT-2 model for answering astronomy questions.
Downloads · 30 days
9
6% of all-time downloads
All-time downloads
163
Public
Parameters
124M
498 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors498 MB · 50%
From the Hugging Face model README
This is a fine-tuned GPT-2 model for answering astronomy questions.
from transformers import GPT2Tokenizer, GPT2LMHeadModel
# Load model
tokenizer = GPT2Tokenizer.from_pretrained("Branis333/astro-gpt2-chatbot")
model = GPT2LMHeadModel.from_pretrained("Branis333/astro-gpt2-chatbot")
# Generate answer
question = "What is a black hole?"
prompt = f"Q: {question}\nA:"
inputs = tokenizer(prompt, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=100, pad_token_id=tokenizer.eos_token_id)
answer = tokenizer.decode(outputs[0], skip_special_tokens=True)
print(answer)
| Epoch | Train Loss | Val Loss | Perplexity |
|---|---|---|---|
| 1 | 0.5524 | 0.4702 | 1.60 |
| 5 | 0.3928 | 0.4498 | 1.57 |
| 10 | 0.2912 | 0.4740 | 1.61 |
The model was trained on cleaned astronomy Q&A pairs covering:
If you use this model, please cite:
@misc{astro-gpt2-chatbot,
author = {Your Name},
title = {Astronomy GPT-2 Chatbot},
year = {2024},
publisher = {HuggingFace},
url = {https://huggingface.co/Branis333/astro-gpt2-chatbot}
}