Downloads · 30 days
4
24% of all-time downloads
Kossayart/klara_ai
klara_ai is a text generation model from Kossayart. Use it when you need the model to write or continue text. It is set up for peft. The card lists the license as llama3.
Note: This model is part of a private graduation project (PFE). Access to weights and the Inference API is restricted to authorized users only.
Downloads · 30 days
4
24% of all-time downloads
All-time downloads
17
Public
Repo size
640 MB
Likes
0
Public
Click a slice to open those files.
Other33 KB · 92%
From the Hugging Face model README
Note: This model is part of a private graduation project (PFE). Access to weights and the Inference API is restricted to authorized users only.
Klara-Llama3-8B-v1 is a sophisticated medical assistant model fine-tuned from Meta's Llama 3 8B. It serves as the intelligent interface for the Klara health monitoring ecosystem, providing expert-level interpretation of physiological sensor data.
This model is not a substitute for professional clinical diagnostics or emergency medical services. It is intended for research and demonstration within the Klara project framework.
Note: Access must be requested and approved via the "Gated Access" system.
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
from peft import PeftModel
model_id = "meta-llama/Meta-Llama-3-8B-Instruct"
adapter_id = "Koussay/Klara-Llama3-8B-v1-LoRA"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
load_in_4bit=True,
device_map="auto",
torch_dtype=torch.bfloat16
)
model = PeftModel.from_pretrained(model, adapter_id)
messages = [
{"role": "system", "content": "You are Klara, a professional medical assistant created by Koussay Chaanbi."},
{"role": "user", "content": "The system detected a sudden drop in SpO2. What are the immediate steps?"}
]
inputs = tokenizer.apply_chat_template(messages, return_tensors="pt").to("cuda")
outputs = model.generate(inputs, max_new_tokens=256)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))