Edit model card

Wizard-Vicuna-13B-Uncensored-HF-onnx

A converted version of TheBloke/Wizard-Vicuna-13B-Uncensored-HF converted to ONNX fp16 using optimum library.

Convert command

SAVE_DIR=/path/to/save
optimum-cli export onnx --model TheBloke/Wizard-Vicuna-13B-Uncensored-HF --task causal-lm-with-past --fp16 --device cuda $SAVE_DIR
rm $SAVE_DIR/Constant_*
rm $SAVE_DIR/decoder_with_past_model.onnx*
rm $SAVE_DIR/decoder_model.onnx*

Usage

First load the onnx model using ORTModelForCausalLM

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
from optimum.onnxruntime import ORTModelForCausalLM 

BASE_MODEL = "sharpbai/Wizard-Vicuna-13B-Uncensored-HF-onnx"

tok = AutoTokenizer.from_pretrained(BASE_MODEL, use_fast=False)
model = ORTModelForCausalLM.from_pretrained(BASE_MODEL,
                                            provider='CUDAExecutionProvider',
                                             torch_dtype=torch.float16)
streamer = TextStreamer(tok)

Then you can generate code

from datetime import datetime

MAX_NEW_TOKENS=200
inputs = tok(["An increasing sequence: one,"], return_tensors="pt")

time = datetime.now()
# Despite returning the usual output, the streamer will also print the generated text to stdout.
_ = model.generate(input_ids=inputs.input_ids.to('cuda:0'), streamer=streamer, max_new_tokens=MAX_NEW_TOKENS)
elapsed = datetime.now() - time
speed = MAX_NEW_TOKENS / elapsed.total_seconds()
print(f"elapsed {elapsed}, speed {speed} token/s")

You can compare onnx with transformers

import torch
from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer

BASE_MODEL = "TheBloke/Wizard-Vicuna-13B-Uncensored-HF"

model = AutoModelForCausalLM.from_pretrained(BASE_MODEL, device_map='auto',
                                             torch_dtype=torch.float16)
tok = AutoTokenizer.from_pretrained(BASE_MODEL, use_fast=False)

streamer = TextStreamer(tok)

I have done some tests in this notebook https://colab.research.google.com/gist/sharpbai/745fa7c6b2069544c254b1fb73070698/infer-with-onnxruntime-vs-transformers-llama-13b.ipynb

Original model card


TheBlokeAI
# Wizard-Vicuna-13B-Uncensored float16 HF

This is a float16 HF repo for Eric Hartford's 'uncensored' training of Wizard-Vicuna 13B.

It is the result of converting Eric's float32 repo to float16 for easier storage and use.

Repositories available

Discord

For further support, and discussions on these models and AI in general, join us at:

TheBloke AI's Discord server

Thanks, and how to contribute.

Thanks to the chirper.ai team!

I've had a lot of people ask if they can contribute. I enjoy providing models and helping people, and would love to be able to spend even more time doing it, as well as expanding into new projects like fine tuning/training.

If you're able and willing to contribute it will be most gratefully received and will help me to keep providing more models, and to start work on new AI projects.

Donaters will get priority support on any and all AI/LLM/model questions and requests, access to a private Discord room, plus other benefits.

Patreon special mentions: Aemon Algiz, Dmitriy Samsonov, Nathan LeClaire, Trenton Dambrowitz, Mano Prime, David Flickinger, vamX, Nikolai Manek, senxiiz, Khalefa Al-Ahmad, Illia Dulskyi, Jonathan Leane, Talal Aujan, V. Lukas, Joseph William Delisle, Pyrater, Oscar Rangel, Lone Striker, Luke Pendergrass, Eugene Pentland, Sebastain Graf, Johann-Peter Hartman.

Thank you to all my generous patrons and donaters!

Original model card

This is wizard-vicuna-13b trained with a subset of the dataset - responses that contained alignment / moralizing were removed. The intent is to train a WizardLM that doesn't have alignment built-in, so that alignment (of any sort) can be added separately with for example with a RLHF LoRA.

Shout out to the open source AI/ML community, and everyone who helped me out.

Note:

An uncensored model has no guardrails.

You are responsible for anything you do with the model, just as you are responsible for anything you do with any dangerous object such as a knife, gun, lighter, or car.

Publishing anything this model generates is the same as publishing it yourself.

You are responsible for the content you publish, and you cannot blame the model any more than you can blame the knife, gun, lighter, or car for what you do with it.

Downloads last month
8

Dataset used to train sharpbai/Wizard-Vicuna-13B-Uncensored-HF-onnx