Skip to content

Instantly share code, notes, and snippets.

@moomou
moomou / utility.py
Created January 6, 2024 04:48
Sampling with Audio
import torch
import whisper
def prompt_template_fn(prompt="Describe the sound of the given file"):
system_message = "You are a helpful AI who follows instruction carefully"
prompt_prefix = f"""<|im_start|>system
{system_message}<|im_end|>
<|im_start|>user
{prompt}"""
@moomou
moomou / main.py
Created January 5, 2024 23:20
MusicCaps data download script
#!/usr/bin/env python3
import multiprocessing
import time
import csv
import subprocess
import pathlib as pl
import os
def format_seconds(seconds):
{
"apiVersion": "v1",
"kind": "PersistentVolume",
"metadata": {
"name": "test-0b-pv"
},
"spec": {
"accessModes": [
"ReadWriteOnce"
],
@moomou
moomou / sample.html
Last active September 4, 2015 06:14
Ekho without username prompt.
<script src="https://ekhoapp.herokuapp.com/embed/bootstrap.js?defaultProfile=__default&activated=true" async></script>
@moomou
moomou / EkhoYoutube.js
Last active September 4, 2015 06:15
Try Ekho on Youtube
/** Precorded commands include
*
* 1. sidebar - toggle the sidebar on Youtube
*/
// Copy and paste the following code into web console on https://youtube.com
var script= document.createElement('script');
script.type= 'text/javascript';
script.src= 'https://ekhoapp.herokuapp.com/embed/bootstrap.js?containerId=masthead-positioner&activated=true&defaultProfile=__default';
document.head.appendChild(script);
@moomou
moomou / EkhoSample.js
Last active September 4, 2015 06:15
Test ekho on any page.
var script= document.createElement('script');
script.type= 'text/javascript';
script.src= 'https://ekhoapp.herokuapp.com/embed/bootstrap.js';
document.head.appendChild(script);
@moomou
moomou / sample.html
Last active September 4, 2015 06:15
How to include Ekho
<script src="https://ekhoapp.herokuapp.com/embed/bootstrap.js?activated=true" async></script>