spear-large-speech
2
—
by
marcoyang
Code Model
OTHER
New
2 downloads
Early-stage
Edge AI:
Mobile
Laptop
Server
Unknown
Mobile
Laptop
Server
Quick Summary
AI model with specialized capabilities.
Code Examples
pythontransformers
from transformers import AutoModel
import torch
model = AutoModel.from_pretrained(
"marcoyang/spear-large-speech",
trust_remote_code=True,
force_download=False,
)
if torch.cuda.is_available():
model = model.to("cuda")
model.eval()
device = next(model.parameters()).device
audio = torch.randn(1, 160000).to(device) # dummy audio input of 10 seconds
audio_len = torch.tensor([160000]).to(device)
with torch.no_grad():
outputs = model(audio, audio_len)
encoder_out = outputs["encoder_out"] # (N,T,C)
encoder_out_lens = outputs["encoder_out_lens"] # (N)
middle_out = outputs["hidden_states"] # list of (N,T,C)
print(encoder_out)
print(encoder_out_lens)
print(len(middle_out)) # 11 layers
print(middle_out[-1].shape)
print(middle_out[-1])Deploy This Model
Production-ready deployment in minutes
Together.ai
Instant API access to this model
Production-ready inference API. Start free, scale to millions.
Try Free APIReplicate
One-click model deployment
Run models in the cloud with simple API. No DevOps required.
Deploy NowDisclosure: We may earn a commission from these partners. This helps keep LLMYourWay free.