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."
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-7Bparameters:density:0.53weight:0.6merge_method:dare_tiesbase_model:timpal0l/Mistral-7B-v0.1-flashback-v2-instructparameters:int8_mask:truedtype: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.
Runs of birgermoell eir on huggingface.co
25
Total runs
1
24-hour runs
1
3-day runs
5
7-day runs
11
30-day runs
More Information About eir huggingface.co Model
eir huggingface.co
eir huggingface.co is an AI model on huggingface.co that provides eir's model effect (), which can be used instantly with this birgermoell eir model. huggingface.co supports a free trial of the eir model, and also provides paid use of the eir. Support call eir model through api, including Node.js, Python, http.
eir huggingface.co is an online trial and call api platform, which integrates eir's modeling effects, including api services, and provides a free online trial of eir, you can try eir online for free by clicking the link below.
birgermoell eir online free url in huggingface.co:
eir is an open source model from GitHub that offers a free installation service, and any user can find eir on GitHub to install. At the same time, huggingface.co provides the effect of eir install, users can directly use eir installed effect in huggingface.co for debugging and trial. It also supports api for free installation.