Views
No views yet
open-voice-detect is a lightweight neural network designed to detect the presence of voice in audio features. This is a minimal "hello world" implementation demonstrating how to structure a PyTorch model for Hugging Face.1import torch
2from model import OpenVoiceDetect
3
4# Load model
5model = OpenVoiceDetect(input_size=128, hidden_size=64)
6checkpoint = torch.load('pytorch_model.bin')
7model.load_state_dict(checkpoint['model_state_dict'])
8model.eval()
9
10# Prepare input (batch_size, 128)
11# In practice, extract 128-dimensional features from audio
12audio_features = torch.randn(1, 128)
13
14# Get prediction
15prediction = model.predict(audio_features)
16print(f"Voice detected: {prediction.item() == 1}")