Downloads · 30 days
0
harithapliyal/llama-3-8b-bnb-4bit-finetuned-SentAnalysis
llama-3-8b-bnb-4bit-finetuned-SentAnalysis is a machine learning model from harithapliyal. 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.
- Developed by: harithapliyal - License: apache-2.0 - Finetuned from model : unsloth/llama-3-8b-bnb-4bit
Downloads · 30 days
0
Access
Public
Updated Sep 8, 2024
Repo size
336 MB
Likes
0
Public
Click a slice to open those files.
.safetensors168 MB · 95%
From the Hugging Face model README
This llama model was trained 2x faster with Unsloth and Huggingface's TRL library.
from google.colab import userdata HF_KEY = userdata.get('HF_KEY')
from unsloth import FastLanguageModel import torch
<!-- from transformers import TrainingArguments from trl import SFTTrainer from unsloth import is_bfloat16_supported !pip uninstall -y xformers !pip install xformers !python -m xformers.info !pip install triton -->from transformers import AutoModelForCausalLM, BitsAndBytesConfig
bnb_config = BitsAndBytesConfig(
load_in_4bit=True,
bnb_4bit_use_double_quant=True,
bnb_4bit_quant_type="nf4",
bnb_4bit_compute_dtype="float16"
)
model1 = AutoModelForCausalLM.from_pretrained(
"harithapliyal/llama-3-8b-bnb-4bit-finetuned-SentAnalysis",
quantization_config=bnb_config
)
FastLanguageModel.for_inference(model1) # Enable native 2x faster inference
inputs = tokenizer(
[
fine_tuned_prompt.format(
"Classify the sentiment of the following text.", # instruction
"I like play yoga under the rain", # input
"", # output - leave this blank for generation!
)
], return_tensors = "pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens = 64, use_cache = True)
outputs = tokenizer.decode(outputs[0])
print(outputs)