Downloads · 30 days
0
imranali291/UIGEN_Qwen2.5-Coder-7B-Instruct-bnb-4bit
UIGEN_Qwen2.5-Coder-7B-Instruct-bnb-4bit is a text generation model from imranali291. Use it when you need the model to write or continue text. The card lists the license as apache-2.0.
Downloads · 30 days
0
Access
Public
Updated Feb 21, 2025
Repo size
173 MB
Likes
0
Public
Click a slice to open those files.
.safetensors162 MB · 91%
From the Hugging Face model README
pip install unsloth
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:
{}"""
FastLanguageModel.for_inference(model) # Enable native 2x faster inference
inputs = tokenizer(
[
alpaca_prompt.format(
"Generate a soft UI login form with a focus on tactile and gentle visual feedback.", # instruction
"", # input
"", # output - leave this blank for generation!
)
], return_tensors = "pt").to("cuda")
outputs = model.generate(**inputs, max_new_tokens = 4096, use_cache = True)
tokenizer.batch_decode(outputs)
from unsloth import FastLanguageModel
model, tokenizer = FastLanguageModel.from_pretrained(
model_name = "imranali291/UIGEN_Qwen2.5-Coder-7B-Instruct-bnb-4bit",
max_seq_length = max_seq_length,
dtype = dtype,
load_in_4bit = load_in_4bit,
)
FastLanguageModel.for_inference(model) # Enable native 2x faster inference
# alpaca_prompt = You MUST copy from above!
inputs = tokenizer(
[
alpaca_prompt.format(
"What is a famous tall tower in Paris?", # 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 = 128)
