Downloads · 30 days
4
17% of all-time downloads
Irutingabo/pregnancy-assistant-tinyllama
pregnancy-assistant-tinyllama is a machine learning model from Irutingabo. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for peft.
This model is a fine-tuned version of TinyLlama/TinyLlama-1.1B-Chat-v1.0 using LoRA (Low-Rank Adaptation) for pregnancy and maternal healthcare questions.
Downloads · 30 days
4
17% of all-time downloads
All-time downloads
23
Public
Repo size
54.3 MB
Likes
0
Public
Click a slice to open those files.
.pt36.2 MB · 63%
From the Hugging Face model README
This model is a fine-tuned version of TinyLlama/TinyLlama-1.1B-Chat-v1.0 using LoRA (Low-Rank Adaptation) for pregnancy and maternal healthcare questions.
This model is designed to provide informational responses to pregnancy and maternal health questions. Important: This model should NOT replace professional medical advice. Always consult qualified healthcare providers for medical concerns.
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
# Load base model
base_model = AutoModelForCausalLM.from_pretrained("TinyLlama/TinyLlama-1.1B-Chat-v1.0")
tokenizer = AutoTokenizer.from_pretrained("TinyLlama/TinyLlama-1.1B-Chat-v1.0")
# Load fine-tuned adapter
model = PeftModel.from_pretrained(base_model, "Irutingabo/pregnancy-assistant-tinyllama")
# Generate response
prompt = "What are the signs of early labor?"
inputs = tokenizer(prompt, return_tensors="pt")
with torch.no_grad():
outputs = model.generate(**inputs, max_new_tokens=200, temperature=0.7)
response = tokenizer.decode(outputs[0], skip_special_tokens=True)