Downloads · 30 days
11
4% of all-time downloads
JCholder/womens-health-chatbot
womens-health-chatbot is a text generation model from JCholder. Use it when you need the model to write or continue text. It is set up for transformers.
This GPT-2 model has been fine-tuned to provide helpful, empathetic responses to questions about women's health and reproductive wellness.
Downloads · 30 days
11
4% of all-time downloads
All-time downloads
272
Public
Parameters
355M
1.4 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors1.4 GB · 100%
From the Hugging Face model README
This GPT-2 model has been fine-tuned to provide helpful, empathetic responses to questions about women's health and reproductive wellness.
from transformers import AutoModelForCausalLM, AutoTokenizer
# Load the model
model = AutoModelForCausalLM.from_pretrained("JCholder/womens-health-chatbot")
tokenizer = AutoTokenizer.from_pretrained("JCholder/womens-health-chatbot")
def ask_health_question(question):
prompt = f"USER: {question}\nDOCTOR:"
inputs = tokenizer(prompt, return_tensors="pt", max_length=400, truncation=True)
outputs = model.generate(
**inputs,
max_new_tokens=120,
temperature=0.7,
top_p=0.9,
repetition_penalty=1.3,
do_sample=True,
pad_token_id=tokenizer.eos_token_id
)
full_response = tokenizer.decode(outputs[0], skip_special_tokens=True)
response = full_response.split("DOCTOR:")[-1].strip()
return response
# Example usage
question = "What causes irregular periods?"
response = ask_health_question(question)
print(response)
// NextJS API Route (pages/api/chat.js)
import { pipeline } from '@huggingface/transformers';
let chatbot;
async function initializeChatbot() {
if (!chatbot) {
chatbot = await pipeline('text-generation', 'JCholder/womens-health-chatbot');
}
return chatbot;
}
export default async function handler(req, res) {
const { message } = req.body;
const model = await initializeChatbot();
const prompt = `USER: ${message}\nDOCTOR:`;
const result = await model(prompt, {
max_new_tokens: 100,
temperature: 0.7,
return_full_text: false
});
const response = result[0].generated_text.trim();
res.json({ response });
}
This model has been designed with healthcare ethics in mind:
@misc{womens-health-chatbot,
title={Women's Health Chatbot},
author={Juliana Holder},
year={2025},
url={https://huggingface.co/JCholder/womens-health-chatbot}
}
Trained on the altaidevorg/women-health-mini dataset containing professional women's health Q&A pairs.
For questions about this model, please refer to the project documentation or contact the model author.