Downloads · 30 days
2
2% of all-time downloads
thibaud-perrin/hibo-mistral-7b-fc-v1.3
hibo-mistral-7b-fc-v1.3 is a text generation model from thibaud-perrin. Use it when you need the model to write or continue text. It is set up for transformers. The card lists the license as mit.
<div align="center" <img src="./img/banner2.webp" width="100%" / </div
Downloads · 30 days
2
2% of all-time downloads
All-time downloads
98
Public
Parameters
7.2B
14.5 GB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors14.5 GB · 100%
From the Hugging Face model README
This model is a fine-tuned version of the mistralai/Mistral-7B-v0.1 for the purpose of instruction following and function calling tasks. It is designed to understand and generate responses based on given instructions or function calls.
Developed by Thibaud Perrin, this model is fine-tuned specifically for the task of interpreting instructions and generating appropriate responses or function calls in English. It leverages the power of the Mistral-7B model, adapting its capabilities to more targeted use cases.
This model is intended for developers, researchers, and hobbyists looking for a pre-trained model capable of understanding and responding to instructions or executing function calls within a given context.
The model can be directly used via the Hugging Face Transformers library for generating text based on prompts related to instructions or function calls.
This model is not intended for high-stakes decisions or scenarios where misunderstanding instructions could lead to significant consequences.
As with any language model, there's a risk of generating biased or inappropriate content. Users should be cautious and evaluate the model's outputs within their specific context.
Users should monitor the model's outputs and apply additional filtering or moderation as needed to ensure the generated content is appropriate for their use case.
from transformers import AutoModelForCausalLM, AutoTokenizer, TextStreamer
model_identifier = "thibaud-perrin/hibo-mistral-7b-fc-v1.3"
model = AutoModelForCausalLM.from_pretrained(
model_identifier,
low_cpu_mem_usage=True,
return_dict=True,
torch_dtype=torch.bfloat16,
device_map={"": 0},
)
tokenizer = AutoTokenizer.from_pretrained(model_identifier)
device = 'cuda:0'
# device = 'cpu'
model.config.use_cache = True
model.eval()
model.to(device)
def stream(user_prompt):
system_prompt = """You are a helpful assistant with access to the following functions. Use them if required -
{
"name": "get_stock_price",
"description": "Get the current stock price of a company",
"parameters": {
"type": "object",
"properties": {
"company_name": {
"type": "string",
"description": "The name of the company"
},
"exchange": {
"type": "string",
"description": "The stock exchange where the company is listed"
}
},
"required": [
"company_name",
"exchange"
]
}
}
"""
messages = [
{"role": "system", "content": system_prompt},
{"role": "user", "content": user_prompt.strip()}
]
transformed_data = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=False)
eos_token_id = tokenizer.eos_token_id
inputs = tokenizer([transformed_data], return_tensors="pt", add_special_tokens=True).to(device)
streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=False)
_ = model.generate(**inputs, streamer=streamer, max_new_tokens=512, eos_token_id=tokenizer.eos_token_id, early_stopping=True)
stream("Hi, can you tell me the current stock price of Apple on NASDAQ? ")
The model was trained using the dataset thibaud-perrin/hibo-function-calling-v1, which consists of various instruction-following and function-calling examples.
The fine-tuned model demonstrates a significant improvement in understanding and generating instruction-based responses compared to the base Mistral-7B model. However this model has been trained, only on the first 50_000 rows of the dataset, with one epoch.
Please cite this dataset using the following BibTeX entry:
@misc{hibo-mistral-7b-fc-v1.3,
author = Thibaud Perrin,
title = hibo-mistral-7b-fc-v1.3: An instruct Model for Function Calling in Conversational AI,
year = 2024,
publisher = Hugging Face,
}