Downloads · 30 days
0
0% of all-time downloads
jjsprockel/Patologia_lora_model1
Patologia_lora_model1 is a machine learning model from jjsprockel. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for transformers. The card lists the license as apache-2.0.
Primera Versión de un LLM ajustado para responder preguntas de Patología
Downloads · 30 days
0
0% of all-time downloads
All-time downloads
2
Public
Repo size
168 MB
Likes
0
Public
Click a slice to open those files.
.safetensors168 MB · 100%
From the Hugging Face model README
Primera Versión de un LLM ajustado para responder preguntas de Patología
Código para descarga: El siguiente es el código sugerido para descargar el modelo usando Unslot:
import torch
from unsloth import FastLanguageModel
model, tokenizer = FastLanguageModel.from_pretrained(
model_name = "jjsprockel/Patologia_lora_model1",
max_seq_length = 2048, # Choose any! Llama 3 is up to 8k
dtype = None,
load_in_4bit = True,
)
FastLanguageModel.for_inference(model)
alpaca_prompt = """Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.
### Instruction:
{}
### Input:
{}
### Response:
{}"""
Código para la inferencia:
El siguiente codigo demuestra como se puede llevar a cabo la inferencia.
instruction = input("Ingresa la pregunta que tengas de Patología: ")
inputs = tokenizer(
[
alpaca_prompt.format(
instruction, # instruction
"", # input
"", # output - leave this blank for generation!
)
], return_tensors = "pt").to("cuda")
from transformers import TextStreamer
text_streamer = TextStreamer(tokenizer)
_ = model.generate(**inputs, streamer = text_streamer, max_new_tokens = 2048)
This llama model was trained 2x faster with Unsloth and Huggingface's TRL library.