import torch
import torchaudio
from transformers import AutoModel
# Load model
model = AutoModel.from_pretrained(
"Vikhrmodels/Borealis-5b-it",
trust_remote_code=True,
device="cuda"
)
model.eval()
# Load audio
audio, sr = torchaudio.load("your_audio.wav")
if sr != 16000:
audio = torchaudio.functional.resample(audio, sr, 16000)
audio = audio.squeeze()
# Generate responsewith torch.inference_mode():
output_ids = model.generate(
audio=audio,
user_prompt="What is being said in this audio? <|start_of_audio|><|end_of_audio|>",
system_prompt="You are a helpful voice assistant.",
max_new_tokens=256,
temperature=0.7,
)
response = model.decode(output_ids[0])
print(response)
Prompt Examples
Audio Transcription
output = model.generate(
audio=audio,
user_prompt="Transcribe this audio: <|start_of_audio|><|end_of_audio|>",
system_prompt="You are a speech recognition assistant. Accurately transcribe audio to text."
)
Audio Summarization
output = model.generate(
audio=audio,
user_prompt="Summarize what is said in this recording: <|start_of_audio|><|end_of_audio|>",
system_prompt="You are a helpful voice assistant."
)
Audio Q&A (Russian)
output = model.generate(
audio=audio,
user_prompt="О чём говорится в этой аудиозаписи? <|start_of_audio|><|end_of_audio|>",
system_prompt="Ты полезный голосовой ассистент."
)
Content Description
output = model.generate(
audio=audio,
user_prompt="Describe in detail what you hear: <|start_of_audio|><|end_of_audio|>",
system_prompt="You are an attentive listener."
)
Emotion Analysis
output = model.generate(
audio=audio,
user_prompt="What emotions does the speaker express? <|start_of_audio|><|end_of_audio|>",
system_prompt="You are an expert in audio analysis."
)
Training Data
The model was fine-tuned on a diverse mix of audio-instruction datasets:
Borealis-5b-it huggingface.co is an AI model on huggingface.co that provides Borealis-5b-it's model effect (), which can be used instantly with this Vikhrmodels Borealis-5b-it model. huggingface.co supports a free trial of the Borealis-5b-it model, and also provides paid use of the Borealis-5b-it. Support call Borealis-5b-it model through api, including Node.js, Python, http.
Borealis-5b-it huggingface.co is an online trial and call api platform, which integrates Borealis-5b-it's modeling effects, including api services, and provides a free online trial of Borealis-5b-it, you can try Borealis-5b-it online for free by clicking the link below.
Vikhrmodels Borealis-5b-it online free url in huggingface.co:
Borealis-5b-it is an open source model from GitHub that offers a free installation service, and any user can find Borealis-5b-it on GitHub to install. At the same time, huggingface.co provides the effect of Borealis-5b-it install, users can directly use Borealis-5b-it installed effect in huggingface.co for debugging and trial. It also supports api for free installation.