medalpaca/medical_meadow_medical_flashcards
Viewer β’ Updated β’ 34k β’ 4.61k β’ 49
How to use SyedaArisha/medical-llama3-lora with Unsloth Studio:
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for SyedaArisha/medical-llama3-lora to start chatting
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for SyedaArisha/medical-llama3-lora to start chatting
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for SyedaArisha/medical-llama3-lora to start chatting
pip install unsloth
from unsloth import FastModel
model, tokenizer = FastModel.from_pretrained(
model_name="SyedaArisha/medical-llama3-lora",
max_seq_length=2048,
)irm https://unsloth.ai/install.ps1 | iex
# Run unsloth studio
unsloth studio -H 0.0.0.0 -p 8888
# Then open http://localhost:8888 in your browser
# Search for SyedaArisha/medical-llama3-lora to start chatting# No setup required# Open https://huggingface.co/spaces/unsloth/studio in your browser
# Search for SyedaArisha/medical-llama3-lora to start chattingpip install unsloth
from unsloth import FastModel
model, tokenizer = FastModel.from_pretrained(
model_name="SyedaArisha/medical-llama3-lora",
max_seq_length=2048,
)A Llama 3 8B model fine-tuned on a medical Q&A dataset for accurate medical question answering.
Training loss reduced from 1.154 β 0.763 across 1,000 steps.
Question: What are the early symptoms of diabetes?
Answer: Polyuria (increased urination) and polydipsia (increased thirst) are the early symptoms of diabetes. These symptoms are caused by the body's attempt to eliminate excess glucose from the bloodstream...
from unsloth import FastLanguageModel
model, tokenizer = FastLanguageModel.from_pretrained(
model_name = "SyedaArisha/medical-llama3-lora",
max_seq_length = 1024,
load_in_4bit = True,
)
FastLanguageModel.for_inference(model)
inputs = tokenizer(
"""Below is a medical question. Answer it accurately.
### Question:
What are the symptoms of hypertension?
### Answer:
""",
return_tensors = "pt"
).to("cuda")
outputs = model.generate(**inputs, max_new_tokens=200)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Fine-tuned using QLoRA with the following configuration:
Syeda Arisha Hassan β Software Engineering Student, COMSATS University Islamabad
Base model
meta-llama/Meta-Llama-3-8B
Install Unsloth Studio (macOS, Linux, WSL)
# Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for SyedaArisha/medical-llama3-lora to start chatting