WARNING:
This is a language model that has undergone instruction tuning for conversational settings that exploit function calling capabilities. It has not been aligned with human preferences. As a result, it may generate outputs that are inappropriate, misleading, biased, or unsafe. These risks can be mitigated through additional post-training stages, which is strongly recommended before deployment in any production system, especially for high-stakes applications.
NOTE:
This is a GATED model, intended only for internal and external tests. Do not request access if you have not already contact us and have been given permission to test it.
Please write carlos.rodriguez1(at)bsc.es to justify use, and we can grant access.
How to use
from datetime import datetime
from transformers import AutoTokenizer, AutoModelForCausalLM
import transformers
import torch
model_id = "BSC-LT/salamandra-7b-instruct"
text = "What is the weather like in Paris today?"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(
model_id,
device_map="auto",
torch_dtype=torch.bfloat16
)
message = [ { "role": "user", "content": text } ]
tools = [{
"type": "function",
"name": "get_weather",
"description": "Get current temperature for a given location.",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "City and country e.g. Bogotá, Colombia"
}
},
"required": [
"location"
],
"additionalProperties": False
}
}]
prompt = tokenizer.apply_chat_template(
message,
tokenize=False,
add_generation_prompt=True,
tools=tools
)
inputs = tokenizer.encode(prompt, add_special_tokens=False, return_tensors="pt")
outputs = model.generate(input_ids=inputs.to(model.device), max_new_tokens=1000)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
salamandra-7b-instruct-tools-16k huggingface.co is an AI model on huggingface.co that provides salamandra-7b-instruct-tools-16k's model effect (), which can be used instantly with this BSC-LT salamandra-7b-instruct-tools-16k model. huggingface.co supports a free trial of the salamandra-7b-instruct-tools-16k model, and also provides paid use of the salamandra-7b-instruct-tools-16k. Support call salamandra-7b-instruct-tools-16k model through api, including Node.js, Python, http.
salamandra-7b-instruct-tools-16k huggingface.co is an online trial and call api platform, which integrates salamandra-7b-instruct-tools-16k's modeling effects, including api services, and provides a free online trial of salamandra-7b-instruct-tools-16k, you can try salamandra-7b-instruct-tools-16k online for free by clicking the link below.
BSC-LT salamandra-7b-instruct-tools-16k online free url in huggingface.co:
salamandra-7b-instruct-tools-16k is an open source model from GitHub that offers a free installation service, and any user can find salamandra-7b-instruct-tools-16k on GitHub to install. At the same time, huggingface.co provides the effect of salamandra-7b-instruct-tools-16k install, users can directly use salamandra-7b-instruct-tools-16k installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
salamandra-7b-instruct-tools-16k install url in huggingface.co: