Edit model card

Eir

Eir är läkekonstens gudinna i nordisk mytologi.

How to use

from transformers import AutoTokenizer
import transformers
import torch

model = "birgermoell/eir"
messages = [
      {"role": "system", "content": "Du är en läkare som är expert i allmänmedicin: Svara på följande fråga:"},
      {"role": "user", "content": "Vad ska jag göra om jag är förkyld?"}]

tokenizer = AutoTokenizer.from_pretrained(model)
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
pipeline = transformers.pipeline(
    "text-generation",
    model=model,
    torch_dtype=torch.float16,
    device_map="auto",
)

outputs = pipeline(prompt, max_new_tokens=512, do_sample=False, temperature=0.7, top_k=50, top_p=0.95, repetition_penalty=1.2)
print(outputs[0]["generated_text"])
>>> "Om du är förkyld är det viktigt att vila och dricka mycket vatten.
Om du har feber, kan du ta paracetamol eller ibuprofen.
Om du har svårare symptom som svår feber, svårare smärtor i halsen,
svårare svullnad i halsen, svårare svårigheter att andas, kan du behöva söka hjälp hos en läkare."
model = "birgermoell/eir"
messages = [
    {"role": "system", "content": "Du är en läkare som är expert i allmänmedicin: Svara på följande fråga:"},
    {"role": "user", "content": "Jag har ont i magen, hur vet jag om jag ska besöka en läkare?"}]

tokenizer = AutoTokenizer.from_pretrained(model)
prompt = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
pipeline = transformers.pipeline(
    "text-generation",
    model=model,
    torch_dtype=torch.float16,
    device_map="auto",
)

outputs = pipeline(prompt, max_new_tokens=512, do_sample=False, temperature=0.7, top_k=50, top_p=0.95, repetition_penalty=1.2)
print(outputs[0]["generated_text"])
>>> "Om du har ont i magen som är svår att förklara, varar längre än tre veckor, eller är kombinerat med andra symtom som viktigast, feber, diarré, blod i avföringen,
minskad aptit, viktförlust, gastroesophageal reflux, nausea, kräkningar, eller svårigheter att svälja, bör du söka hjälp av en läkare."

This model is a merge of https://huggingface.co/timpal0l/Mistral-7B-v0.1-flashback-v2-instruct and https://huggingface.co/BioMistral/BioMistral-7B.

Configuration

The following YAML configuration was used to produce this model:

models:
  - model: timpal0l/Mistral-7B-v0.1-flashback-v2-instruct
    # No parameters necessary for base model
  - model: BioMistral/BioMistral-7B
    parameters:
      density: 0.53
      weight: 0.6
merge_method: dare_ties
base_model: timpal0l/Mistral-7B-v0.1-flashback-v2-instruct
parameters:
  int8_mask: true
dtype: bfloat16

CAUTION!

Both direct and downstream users need to be informed about the risks, biases, and constraints inherent in the model. While the model can produce natural language text, our exploration of its capabilities and limitations is just beginning. In fields such as medicine, comprehending these limitations is crucial. Hence, we strongly advise against deploying this model for natural language generation in production or for professional tasks in the realm of health and medicine.

Downloads last month
136
Safetensors
Model size
7.24B params
Tensor type
BF16
·

Merge of