Downloads · 30 days
0
ArvindSharma18/Phi-3-mini-4k-instruct-bnb-4bit-Clinical-Trail-Exp
Phi-3-mini-4k-instruct-bnb-4bit-Clinical-Trail-Exp is a machine learning model from ArvindSharma18. 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 creativeml-openrail-m.
- This is an Experiment to generate Clinical Trial Synopsis. Will be making a better one Soon! Stay Updated - Model ArvindSharma18/Phi-3-mini-4k-instruct-bnb-4bit-Clinical-Trail-Merged-Exp
Downloads · 30 days
0
Access
Public
Updated Aug 15, 2024
Repo size
2.3 GB
Likes
0
Public
Click a slice to open those files.
.safetensors514 MB · 100%
From the Hugging Face model README
Note: May Hallucinate(The purpose is to have a foundational model for more downstream tasks built on top of it) or Repeat Eligibility Criteria in case of some trials. Working on making it more reliable.
from unsloth import FastLanguageModel
import torch
max_seq_length = 4096
dtype = torch.float16
load_in_4bit = True
model, tokenizer = FastLanguageModel.from_pretrained(
model_name = "ArvindSharma18/Phi-3-mini-4k-instruct-bnb-4bit-Clinical-Trail-Merged-Exp", # "unsloth/mistral-7b" for 16bit loading
max_seq_length = max_seq_length,
dtype = dtype,
load_in_4bit = load_in_4bit
)
FastLanguageModel.for_inference(model)
inputs = tokenizer(
[
"Write Clinical Trial Summary for Effects of High-protein Milk Supplementation on Muscular Strength and Power, Body Composition, and Skeletal Muscle Regulatory Markers Following Heavy Resistance Training in Resistance-trained Men"
], return_tensors = "pt").to("cuda")
from transformers import TextStreamer
text_streamer = TextStreamer(tokenizer, skip_prompt = True)
_ = model.generate(input_ids = inputs.input_ids, attention_mask = inputs.attention_mask,
streamer = text_streamer, max_new_tokens = 4096, do_sample=True)