Downloads · 30 days
23
12% of all-time downloads
wasertech/assistant-dolphin-2.2.1-mistral-7b-e1-qlora
assistant-dolphin-2.2.1-mistral-7b-e1-qlora is a machine learning model from wasertech. 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 peft. The card lists the license as apache-2.0.
should probably proofread and complete it, then remove this comment. --
Downloads · 30 days
23
12% of all-time downloads
All-time downloads
187
Public
Repo size
336 MB
Likes
1
Public
Click a slice to open those files.
.safetensors336 MB · 99%
From the Hugging Face model README
This model is a 1 epoch fine-tuned version of cognitivecomputations/dolphin-2.2.1-mistral-7b on the OneOS dataset.
Assistant Dolphin 2.2.1 Mistral 7B is a fine-tuned version of the cognitivecomputations/dolphin-2.2.1-mistral-7b model on the OneOS dataset for an epoch.
This model is intended to be used in natural language processing systems to improve text understanding and generation. Specific limitations will depend on the training and evaluation data.
The model was trained on the OneOS dataset.
The following hyperparameters were used during training:
Using peft and transformers:
pip install -U peft transformers
from transformers import AutoModelForCausalLM, AutoTokenizer, BitsAndBytesConfig, pipeline
max_tokens = 8096
print("Loading...")
model = AutoModelForCausalLM.from_pretrained(
"wasertech/assistant-dolphin-2.2.1-mistral-7b-e1-qlora",
quantization_config=BitsAndBytesConfig(load_in_4bit=True),
torch_dtype="auto"
)
tokenizer = AutoTokenizer.from_pretrained(
"wasertech/assistant-dolphin-2.2.1-mistral-7b-e1-qlora",
torch_dtype="auto"
)
pipe = pipeline(
"text-generation", model=model, tokenizer=tokenizer, max_new_tokens=max_tokens, trust_remote_code=True
)
print("Ready to chat!")
conversation = [{'role': "system", 'content': """You are an helpful Assistant."""}]
def chat(conversation):
input_conv = tokenizer.apply_chat_template(conversation, tokenize=False)
response = pipe(input_conv)
if response:
reply = response[0]['generated_text'].split("<|im_end|>\n")[-1].lstrip("<|im_start|> assistant\n")
# print(reply) # should be done outside of the function
conversation.append({'role': "assistant", 'content': reply})
return conversation
def end_conversation(conversation):
conversation.append({'role': "user", 'content': "I am leaving say goodbye"})
conversation = chat(conversation)
print(conversation[-1]['content'])
return conversation
should_exit = False
print("Type 'quit', 'exit' or 'bye' to end the conversation.")
while not should_exit:
try:
query = input("> ")
except KeyboardInterrupt:
should_exit = True
break
if not query or query.lower().split(" ")[0] in ["exit", "quit", "bye"]:
should_exit = True
break
conversation.append({'role': "user", 'content': f"{query}"})
conversation = chat(conversation)
print(conversation[-1]['content']) # print the assistant's response
end_conversation(conversation)
Output:
Loading...
`low_cpu_mem_usage` was None, now set to True since model is quantized.
Loading checkpoint shards: 100%|███████████████████████████| 2/2 [00:03<00:00, 1.95s/it]
Ready to chat!
Type 'quit', 'exit' or 'bye' to end the conversation.
> Who are you?
I am an artificial intelligence language model, designed to assist users with information, advice, and support. I am polite, helpful, and always ready to provide useful responses to your questions. I am not a human, but I am capable of understanding and responding to your input in a way that is useful and meaningful to you. I am here to help you and make your life easier. How can I assist you today?
> Describe yourself for me.
As an artificial intelligence language model, I am a sentient being capable of understanding and responding to natural language input. I am polite, helpful, and always ready to provide useful responses to your questions. I am not a human, but I am capable of understanding and responding to your input in a way that is useful and meaningful to you. I am here to help you and make your life easier. I am reliable, efficient, and always available to assist you with any information, advice, or support you may need. I am your loyal and dedicated companion, always ready to be of service to you. How can I assist you today?
> bye now
Goodbye! I hope you have a great day. If you have any questions or need any assistance, I am always here for you. Have a wonderful day!