MedFAQ
Collection
LLMs fine-tuned on kazcfz/Llama-2-7b-chat-FAQ • 2 items • Updated
How to use kazcfz/Llama-2-7b-chat-MedFAQ2 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-generation", model="kazcfz/Llama-2-7b-chat-MedFAQ2") # Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("kazcfz/Llama-2-7b-chat-MedFAQ2")
model = AutoModelForCausalLM.from_pretrained("kazcfz/Llama-2-7b-chat-MedFAQ2", device_map="auto")How to use kazcfz/Llama-2-7b-chat-MedFAQ2 with vLLM:
# Install vLLM from pip:
pip install vllm
# Start the vLLM server:
vllm serve "kazcfz/Llama-2-7b-chat-MedFAQ2"
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:8000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "kazcfz/Llama-2-7b-chat-MedFAQ2",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker model run hf.co/kazcfz/Llama-2-7b-chat-MedFAQ2
How to use kazcfz/Llama-2-7b-chat-MedFAQ2 with SGLang:
# Install SGLang from pip:
pip install sglang
# Start the SGLang server:
python3 -m sglang.launch_server \
--model-path "kazcfz/Llama-2-7b-chat-MedFAQ2" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "kazcfz/Llama-2-7b-chat-MedFAQ2",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'docker run --gpus all \
--shm-size 32g \
-p 30000:30000 \
-v ~/.cache/huggingface:/root/.cache/huggingface \
--env "HF_TOKEN=<secret>" \
--ipc=host \
lmsysorg/sglang:latest \
python3 -m sglang.launch_server \
--model-path "kazcfz/Llama-2-7b-chat-MedFAQ2" \
--host 0.0.0.0 \
--port 30000
# Call the server using curl (OpenAI-compatible API):
curl -X POST "http://localhost:30000/v1/completions" \
-H "Content-Type: application/json" \
--data '{
"model": "kazcfz/Llama-2-7b-chat-MedFAQ2",
"prompt": "Once upon a time,",
"max_tokens": 512,
"temperature": 0.5
}'How to use kazcfz/Llama-2-7b-chat-MedFAQ2 with Docker Model Runner:
docker model run hf.co/kazcfz/Llama-2-7b-chat-MedFAQ2
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
NousResearch/Llama-2-7b-chat-hf fine-tuned on kazcfz/MedFAQ-llama2-2k
QLoRA parameters
| Parameter | Value |
|---|---|
| lora_r | 64 |
| lora_alpha | 16 |
| lora_dropout | 0.1 |
bitsandbytes parameters
| Parameter | Value |
|---|---|
| use_4bit | True |
| bnb_4bit_compute_dtype | "float16" |
| bnb_4bit_quant_type | "nf4" |
| use_nested_quant | False |
TrainingArguments parameters
| Parameter | Value |
|---|---|
| num_train_epochs | 5 |
| fp16 | False |
| bf16 | False |
| per_device_train_batch_size | 4 |
| gradient_accumulation_steps | 1 |
| gradient_checkpointing | True |
| max_grad_norm | 0.3 |
| learning_rate | 2e-4 |
| weight_decay | 0.001 |
| optim | "paged_adamw_32bit" |
| lr_scheduler_type | "cosine" |
| max_steps | -1 |
| warmup_ratio | 0.03 |
| group_by_length | True |
| save_steps | 0 |
| logging_steps | 25 |
SFT parameters
| Parameter | Value |
|---|---|
| max_seq_length | None |
| packing | False |
<s>[INST] {prompt} [/INST]
Base Model
Query: <s>[INST] Am I at risk for kidney disease? [/INST]
Response: I cannot provide medical advice or diagnose any health conditions, including kidney disease. everybody's health is unique, and there are many factors that can increase or decrease the risk of developing kidney disease. However, I can provide some general information on the risk factors for kidney disease and suggest ways to reduce your risk.
Risk factors for kidney disease include:
1. Family history: If you have a family history of kidney disease, you are more likely to develop the condition.
2. Diabetes: Diabetes is a common cause of kidney disease. If you have diabetes, you are at a higher risk of developing kidney disease.
3. High blood pressure: High blood pressure can damage the kidneys and increase the risk of kidney disease.
4. Obesity: Being overweight or obese can increase
Fine-tuned
Query: <s>[INST] Am I at risk for kidney disease? [/INST]
Response: Your risk for kidney disease depends on your age, race, and medical history. If you have any of the following risk factors, talk to your doctor about your risk for kidney disease:
Family history of kidney disease
High blood pressure
Diabetes
High cholesterol
African American or Hispanic/Latino ethnicity
History of kidney disease in your family
History of stroke or heart disease
Obesity
Certain medications, such as certain antibiotics, NSAIDs, and certain medications for depression
Certain medical conditions, such as polycystic kidney disease (PKD), lupus, and certain genetic disorders Source: FRESENIUS KIDNEY CARE. Link: https://www.freseniuskidneycare.com/fre
Reload model + Merge LoRA weights?
Query: <s>[INST] Am I at risk for kidney disease? [/INST]
Response: Your risk for kidney disease depends on your age, family medical history, and other factors.
Risk factors for kidney disease include:
Diabetes
High blood pressure
African American or Hispanic/Latino race
Family history of kidney disease
Obesity
Certain medical conditions, such as high cholesterol, heart disease, and polycystic kidney disease
If you have any of these risk factors, talk to your doctor about your risk for kidney disease. Source: THE UNIVERSITY OF KANSAS HEALTH SYSTEM. Link: https://www.kansashealthsystem.com/care/conditions/kidney-disease/kidney-disease-faq. Field: Nephrology. Disease: Kidney D