FireFunction is a state-of-the-art function calling model with a commercially viable license. View detailed info in our
announcement blog
. Key info and highlights:
Comparison with other models:
Competitive with GPT-4o at function-calling, scoring 0.81 vs 0.80 on a medley of public evaluations
Trained on Llama 3 and retains Llama 3’s conversation and instruction-following capabilities, scoring 0.84 vs Llama 3’s 0.89 on MT bench
Significant quality improvements over FireFunction v1 across the broad range of metrics
from transformers import AutoModelForCausalLM, AutoTokenizer
import json
from datetime import datetime
device = "cuda"# the device to load the model onto
model = AutoModelForCausalLM.from_pretrained("fireworks-ai/firefunction-v2", device_map="auto")
tokenizer = AutoTokenizer.from_pretrained("fireworks-ai/firefunction-v2")
function_spec = [
{
"name": "get_stock_price",
"description": "Get the current stock price",
"parameters": {
"type": "object",
"properties": {
"symbol": {
"type": "string",
"description": "The stock symbol, e.g. AAPL, GOOG"
}
},
"required": [
"symbol"
]
}
},
{
"name": "check_word_anagram",
"description": "Check if two words are anagrams of each other",
"parameters": {
"type": "object",
"properties": {
"word1": {
"type": "string",
"description": "The first word"
},
"word2": {
"type": "string",
"description": "The second word"
}
},
"required": [
"word1",
"word2"
]
}
}
]
functions = json.dumps(function_spec, indent=4)
messages = [
{'role': 'system', 'content': 'You are a helpful assistant with access to functions. Use them if required.'},
{'role': 'user', 'content': 'Hi, can you tell me the current stock price of google and netflix?'}
]
now = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
model_inputs = tokenizer.apply_chat_template(messages, functions=functions, datetime=now, return_tensors="pt").to(model.device)
generated_ids = model.generate(model_inputs, max_new_tokens=128)
decoded = tokenizer.batch_decode(generated_ids)
print(decoded[0])
llama-3-firefunction-v2-GGUF huggingface.co is an AI model on huggingface.co that provides llama-3-firefunction-v2-GGUF's model effect (), which can be used instantly with this mav23 llama-3-firefunction-v2-GGUF model. huggingface.co supports a free trial of the llama-3-firefunction-v2-GGUF model, and also provides paid use of the llama-3-firefunction-v2-GGUF. Support call llama-3-firefunction-v2-GGUF model through api, including Node.js, Python, http.
llama-3-firefunction-v2-GGUF huggingface.co is an online trial and call api platform, which integrates llama-3-firefunction-v2-GGUF's modeling effects, including api services, and provides a free online trial of llama-3-firefunction-v2-GGUF, you can try llama-3-firefunction-v2-GGUF online for free by clicking the link below.
mav23 llama-3-firefunction-v2-GGUF online free url in huggingface.co:
llama-3-firefunction-v2-GGUF is an open source model from GitHub that offers a free installation service, and any user can find llama-3-firefunction-v2-GGUF on GitHub to install. At the same time, huggingface.co provides the effect of llama-3-firefunction-v2-GGUF install, users can directly use llama-3-firefunction-v2-GGUF installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
llama-3-firefunction-v2-GGUF install url in huggingface.co: