Downloads · 30 days
21
11% of all-time downloads
SpectreLynx/Ryeta-0
Ryeta-0 is a text generation model from SpectreLynx. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as other.
Built upon the powerful LLaMa-3 architecture and fine-tuned on an extensive dataset of health information, this model leverages its vast medical knowledge to offer clear, comprehensive answers.
Downloads · 30 days
21
11% of all-time downloads
All-time downloads
195
Public
Parameters
8B
16.1 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors16.1 GB · 100%
From the Hugging Face model README
Built upon the powerful LLaMa-3 architecture and fine-tuned on an extensive dataset of health information, this model leverages its vast medical knowledge to offer clear, comprehensive answers.
This model is generally better for accurate and informative responses, particularly for users seeking in-depth medical advice.
| Subject | Model Accuracy (%) |
|---|---|
| Clinical Knowledge | 71.70 |
| Medical Genetics | 78.00 |
| Human Aging | 70.40 |
| Human Sexuality | 73.28 |
| College Medicine | 62.43 |
| Anatomy | 64.44 |
| College Biology | 72.22 |
| High School Biology | 77.10 |
| Professional Medicine | 63.97 |
| Nutrition | 73.86 |
| Professional Psychology | 68.95 |
| Virology | 54.22 |
| High School Psychology | 83.67 |
| Average | 70.33 |
import torch
from transformers import AutoTokenizer, AutoModelForCausalLM
class MedicalAssistant:
def __init__(self, model_name="SpectreLynx/Ryeta-0", device="cuda"):
self.device = device
self.tokenizer = AutoTokenizer.from_pretrained(model_name)
self.model = AutoModelForCausalLM.from_pretrained(model_name).to(self.device)
self.sys_message = '''
You are an AI Medical Assistant trained on a vast dataset of health information. Please be thorough and
provide an informative answer. If you don't know the answer to a specific medical inquiry, advise seeking professional help.
'''
def format_prompt(self, question):
messages = [
{"role": "system", "content": self.sys_message},
{"role": "user", "content": question}
]
prompt = self.tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
return prompt
def generate_response(self, question, max_new_tokens=512):
prompt = self.format_prompt(question)
inputs = self.tokenizer(prompt, return_tensors="pt").to(self.device)
with torch.no_grad():
outputs = self.model.generate(**inputs, max_new_tokens=max_new_tokens, use_cache=True)
answer = self.tokenizer.batch_decode(outputs, skip_special_tokens=True)[0].strip()
return answer
if __name__ == "__main__":
assistant = MedicalAssistant()
question = '''
Symptoms:
Dizziness, headache, and nausea.
What is the differential diagnosis?
'''
response = assistant.generate_response(question)
print(response)