/ Модель

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

Контекст
2 048 токенов
Параметры
138 млн
Лицензия
Apache 2.0
Архитектура
llama · dense
Библиотека
transformers
Опубликована
31 мая 2024

Doctor-Llama-160m

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

Небольшая модель Llama, дообученная на медицинских данных на бразильском португальском языке для изучения и экспериментов с генерацией текста.

52скачиваний за 30 дней0лайковвеса обновлены24 авг 2024

Бенчмарки

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Doctor Llama 160m — языковая модель Mariana Moreira dos Santos, созданная в рамках выпускного проекта по биомедицинской информатике Федерального университета Параны. Это версия TeenyTinyLlama-160m, дообученная на медицинском наборе medicine-training-pt; архитектура — плотная Llama с причинно-языковой генерацией. Модель содержит 137,8 млн параметров, принимает текст и генерирует текст, рассчитана на контекст до 2048 токенов и бразильский португальский язык.

Модель предназначена для изучения процесса дообучения небольших языковых моделей на португальском языке с медицинскими данными и для экспериментальной генерации медицинских текстов. В опубликованной оценке perplexity снизилась с 22,51 у базовой TeenyTinyLlama-160m до 15,68, однако автор прямо указывает, что модель не предназначена для развёртывания или взаимодействия с людьми. Распространяется по лицензии Apache 2.0.

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

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

Ограничения

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

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

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

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

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

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

Открыть на Hugging Face

Doctor Llama 160m

This repository contains a version of TeenyTinyLlama-160m fine-tuned on the medicine-training-pt dataset.

The main objective of the Doctor Llama model was to study the step-by-step process involved in fine-tuning models in Portuguese, taking into account the challenges encountered in the medical field.

This model was created as part of the course completion project for Biomedical Informatics at the Federal University of Paraná. For more information, access the full text at the following link.

Author

Mariana Moreira dos Santos (LinkedIn)

Code

You can check the codes used to fine-tune the model at the following Google Colab link.

Fine-tuning details

Parameters

  • Number of Epochs: 4
  • Batch size: 8
  • Optimizer: torch.optim.AdamW (warmup_steps = 1e3, learning_rate = 1e-5, epsilon = 1e-8)

Evaluations

ModelPerplexityEvaluation Loss
TeenyTinyLlama 160m22.513.11
Doctor Llama 160m15.682.75
TeenyTinyLlama 460m13.092.57
Doctor Llama 460m10.942.39
TeenyTinyLlama 460m Chat21.223.05
Doctor Llama Chat11.132.41

Basic usage

Using the pipeline:

from transformers import pipeline

generator = pipeline("text-generation", model="mmoreirast/Doctor-Llama-160m")

completions  = generator("Me fale sobre o sistema nervoso", num_return_sequences=2, max_new_tokens=100)

for comp in completions:
  print(f"🤖 {comp['generated_text']}")

Using the AutoTokenizer and AutoModelForCausalLM:

from transformers import AutoTokenizer, AutoModelForCausalLM
import torch

# Load model and the tokenizer
tokenizer = AutoTokenizer.from_pretrained("mmoreirast/Doctor-Llama-160m", revision='main')
model = AutoModelForCausalLM.from_pretrained("mmoreirast/Doctor-Llama-160m", revision='main')

# Pass the model to your device
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
model.eval()
model.to(device)

# Tokenize the inputs and pass them to the device
inputs = tokenizer("Me fale sobre o sistema nervoso", return_tensors="pt").to(device)

# Generate some text
completions = model.generate(**inputs, num_return_sequences=2, max_new_tokens=100)

# Print the generated text
for i, completion in enumerate(completions):
    print(f'🤖 {tokenizer.decode(completion)}')

Intended Uses

The main objective of the Doctor Llama model was to study the step-by-step process involved in fine-tuning models in Portuguese, taking into account the challenges encountered in the medical field. You may also further fine-tune and adapt Doctor Llama for deployment, as long as your use is following the Apache 2.0 license. If you decide to use pre-trained Doctor Llama as a basis for your fine-tuned model, please conduct your own risk and bias assessment.

Out-of-scope Use

Doctor Llama is not intended for deployment. It is not a product and should not be used for human-facing interactions.

Doctor Llama models are Brazilian Portuguese language only and are not suitable for translation or generating text in other languages.

Limitations

As described in the Teeny Tiny Llama model, the Doctor Llama also has the following limitations:

  • Hallucinations: This model can produce content that can be mistaken for truth but is, in fact, misleading or entirely false, i.e., hallucination.

  • Biases and Toxicity: This model inherits the social and historical stereotypes from the data used to train it. Given these biases, the model can produce toxic content, i.e., harmful, offensive, or detrimental to individuals, groups, or communities.

  • Unreliable Code: The model may produce incorrect code snippets and statements. These code generations should not be treated as suggestions or accurate solutions.

  • Language Limitations: The model is primarily designed to understand standard Brazilian Portuguese. Other languages might challenge its comprehension, leading to potential misinterpretations or errors in response.

  • Repetition and Verbosity: The model may get stuck on repetition loops (especially if the repetition penalty during generations is set to a meager value) or produce verbose responses unrelated to the prompt it was given.

Hence, even though our models are released with a permissive license, we urge users to perform their risk analysis on these models if intending to use them for real-world applications and also have humans moderating the outputs of these models in applications where they will interact with an audience, guaranteeing users are always aware they are interacting with a language model.

Cite as 🤗

@misc{moreira2024docllama,
  title = {Um Estudo sobre LLMs em Português para a Área Médica},
  author = {Mariana Moreira dos Santos, André Ricardo Abed Grégio},
  url = {},
  year={2024}
}

Acknowledgements

The TeenyTinyLlama base models used here were created by Nicholas Kluge Corrêa and his team. For more information, visit TeenyTinyLlama.

License

Doctor Llama is licensed under the Apache License, Version 2.0. See the LICENSE file for more details.

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

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

GPU в ailist

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

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

Подбираем GPU…

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

0 моделей