/ Модель

Характеристики

Контекст
8 192 токена
Параметры
7,5 млрд
Размер весов
16,1 ГБ
Лицензия
Своя лицензия
Архитектура
llama · dense
Базовая модель
ai-medical-model-32bit
Библиотека
transformers
Опубликована
2 июн 2024

Medichat-V2-Llama3-8B

Генерация текстаТекст → текст3 профессии

Объединённая медицинская модель на базе Llama 3 для диалоговых ответов на медицинские вопросы и структурирования клинических текстов.

29скачиваний за 30 дней7лайковвеса обновлены4 июн 2024

Бенчмарки

Как модель справилась с задачами пользователей ailist и что о ней публикуют открытые лидерборды

Тесты пользователейпока нет

Никто ещё не опубликовал тест этой модели. Соберите бенчмарк из своих задач — результат появится здесь.

  1. Добавьте модель в бенчмарк

    Вместе с другими моделями категории «Текст» — сравнение идёт внутри одной категории.

  2. Опишите свои задачи

    Напишите запросы, при необходимости приложите файлы и эталонные ответы.

  3. Запустите и опубликуйте

    Модели ответят на каждую задачу, судья оценит ответы. Опубликованный результат появится на этой странице.

Публичные оценки

Из открытых лидербордов. Сравнивайте результаты одного теста при одинаковых условиях — отсутствие оценки не значит, что модель хуже.

В подключённых источниках результатов для этой модели пока нет.

Что умеет модель

Описание составлено по карточке модели и метаданным Hugging Face

Medichat-V2-Llama3-8B — медицинская разговорная языковая модель, созданная Sethuiyer путём объединения предварительно обученных моделей с помощью mergekit и метода DARE TIES. В основе лежит refuelai/Llama-3-Refueled; в объединение также вошли медицинская модель ruslanmv/ai-medical-model-32bit и Locutusque/Llama-3-Hercules-5.0-8B. Модель имеет архитектуру LlamaForCausalLM, содержит 7,5 млрд параметров и рассчитана на контекст до 8192 токенов.

Модель предназначена для ответов на медицинские вопросы в диалоговом формате и особенно полезна для структурирования неструктурированных клинических текстов. Карточка описывает англоязычные данные и медицинскую специализацию; модель принимает текст и генерирует текст.

Модель распространяется в формате safetensors под лицензией other, поэтому условия использования следует сверять с лицензией и условиями исходных моделей. Ответы могут содержать ошибки и не заменяют оценку квалифицированного медицинского специалиста.

Сценарии применения

  • структурирование неразмеченных клинических записей
  • ответы на технические медицинские вопросы
  • медицинский чат-бот для англоязычных пользователей

Ограничения

Карточка не приводит оценок качества или клинической валидации; ответы могут быть неточными и не должны использоваться вместо профессиональной медицинской оценки. Указана лицензия other, поэтому перед применением нужно проверить условия лицензии и исходных моделей.

Для каких профессий подходит3

Разделы каталога профессий, в задачах которых используется эта модель

Все профессии

Карточка модели

README от автора на Hugging Face, как он его опубликовал

Открыть на Hugging Face

Medichat-V2-Llama3-8B

This is a merge of pre-trained language models created using mergekit.

This model is particularly effective in structuring the unstructured clinical texts.

Model Composition and Features:

  1. Base Model: The foundation of this model is based on "refuelai/Llama-3-Refueled," which itself is a refined version of the Llama3-8B model, renowned for its instruction-following capabilities and adaptability across various domains.

  2. Merged Models:

    • ruslanmv/ai-medical-model-32bit: A model fine-tuned specifically for answering technical medical questions, providing a solid base of medical knowledge.
    • Locutusque/Llama-3-Hercules-5.0-8B: Known for its ability to follow complex instructions and handle conversational interactions effectively, especially in scientific and technical contexts.

This model was merged using the DARE TIES merge method using refuelai/Llama-3-Refueled as a base.

Models Merged

The following models were included in the merge:

Configuration

The following YAML configuration was used to produce this model:



models:
  - model: Locutusque/Llama-3-Hercules-5.0-8B
    parameters:
      weight: [0.25, 0.35, 0.45, 0.35, 0.25]
      density: [0.1, 0.25, 0.5, 0.25, 0.1]
  - model: refuelai/Llama-3-Refueled
  - model: ruslanmv/ai-medical-model-32bit
    parameters:
      weight: [0.55, 0.45, 0.35, 0.45, 0.55]
      density: [0.1, 0.25, 0.5, 0.25, 0.1]
merge_method: dare_ties
base_model: refuelai/Llama-3-Refueled
parameters:
  int8_mask: true
dtype: bfloat16


Usage

import torch
from transformers import AutoTokenizer, AutoModelForCausalLM

class MedicalAssistant:
    def __init__(self, model_name="sethuiyer/Medichat-V2-Llama3-8B", 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
assistant = MedicalAssistant()
question = '''
Symptoms:
Dizziness, headache, and nausea.

What is the differential diagnosis?
'''
response = assistant.generate_response(question)
print(response)
Based on the symptoms of dizziness, headache, and nausea, the differential diagnosis could include several conditions. Here are some possible causes:

1. Vestibular disorders: These can cause dizziness, vertigo, and nausea. Examples include benign paroxysmal positional vertigo (BPPV), labyrinthitis, and vestibular neuritis.

2. Migraine: Migraines can cause severe headaches, nausea, and dizziness. They can be triggered by various factors, such as stress, changes in sleep patterns, or certain foods.

3. Inner ear infections: Infections in the inner ear, such as labyrinthitis or otitis media, can cause dizziness, nausea, and headache.

4. Meniere's disease: This is a disorder of the inner ear that can cause episodes of vertigo, nausea, and hearing loss.

5. Motion sickness: This can occur when the body receives conflicting signals from the eyes, inner ear, and other sensory systems. It can cause dizziness, nausea, and headache.

6. Anxiety or panic attacks: Anxiety or panic attacks can cause dizziness, nausea, and headache.

7. Low blood sugar (hypoglycemia): Low blood sugar can cause dizziness, headache, and nausea.

8. Medication side effects: Certain medications, such as antibiotics, antihistamines, and antidepressants, can cause dizziness, headache, and nausea as side effects.

9. Stroke or transient ischemic attack (TIA): These can cause sudden onset of dizziness, headache, and nausea.

10. Brain tumor or other central nervous system disorders: Rarely, a brain tumor or other central nervous system disorder can cause dizziness, headache, and nausea.

It is essential to consult a healthcare professional for a proper evaluation and diagnosis. They will likely perform a physical examination, take a detailed medical history, and order appropriate tests to determine the underlying cause of the symptoms. Treatment will depend on the specific diagnosis and may include medications, lifestyle changes, or other interventions.

prompt = '''
A 52-year-old woman comes to the physician because of a 6-month history of generalized fatigue, low-grade fever, and a 10-kg (22-lb) weight loss. Physical examination shows generalized pallor and splenomegaly. Her hemoglobin concentration is 7.5 g/dL and leukocyte count is 41,800/mm3. Leukocyte alkaline phosphatase activity is low. Peripheral blood smear shows basophilia with myelocytes and metamyelocytes. Bone marrow biopsy shows cellular hyperplasia with proliferation of immature granulocytic cells. Which of the following mechanisms is most likely responsible for this patient's condition?
    Output JSON in this format.
    {
    "age":
    "gender"
    "past medicial history"
    "present symptoms"
    "interventions"
    "lab tests"
    "medications"
    "possible diseases"
    }
    
    PLEASE WRITE ONLY JSON
'''
response = assistant.generate_response(prompt)
print(response)
{
    "age": 52,
    "gender": "female",
    "past medical history": "unknown",
    "present symptoms": "generalized fatigue, low-grade fever, 10-kg (22-lb) weight loss",
    "interventions": "bone marrow biopsy",
    "lab tests": "hemoglobin concentration: 7.5 g/dL, leukocyte count: 41,800/mm3, leukocyte alkaline phosphatase activity: low, peripheral blood smear: basophilia with myelocytes and metamyelocytes",
    "medications": "none",
    "possible diseases": "chronic myeloid leukemia"
}

Quants

Quants of this model is available at mradermacher/Medichat-V2-Llama3-8B-GGUF

Как запустить

На своей GPU в ailist. Цена — по текущим предложениям провайдеров

GPU в ailist

Универсальный рантайм · transformers

Можно запустить

Подбираем GPU…

Класс архитектуры
LlamaForCausalLM
Ревизия весов
602c422

0 моделей