Run this model with HF Jobs

Run Agnes-AI/Agnes-Video-H3-MoE on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.

Paste one of these prompts into your coding agent:

Fine-tune on my dataset

Use HF Jobs to fine-tune https://huggingface.co/Agnes-AI/Agnes-Video-H3-MoE. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.

Run batch inference

Use HF Jobs to run batch inference with https://huggingface.co/Agnes-AI/Agnes-Video-H3-MoE on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
File size: 842 Bytes
f2a1383
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import torch

def generate_click(bpm, sample_rate=48000, duration=None, length=None, click_duration=0.01, click_freq=1000, bias=0):
    num_samples = int(duration * sample_rate) if duration is not None else length
    if duration is None: duration = length / sample_rate
    click_len = int(click_duration * sample_rate)
    t = torch.arange(click_len, dtype=torch.float64) / sample_rate
    click = 0.5 * torch.sin(2 * torch.pi * click_freq * t) * torch.exp(-t * 100)

    output = torch.zeros(num_samples, dtype=torch.float64)
    for idx in (torch.arange(0, duration, 60.0 / bpm) * sample_rate).long():
        idx = int(idx + bias * 60.0 / bpm * sample_rate)
        end = min(idx + click_len, num_samples)
        output[idx:end] += click[:end - idx]

    output /= output.abs().max()
    return output.float().unsqueeze(0).repeat(2, 1)