Skip to content

Instantly share code, notes, and snippets.

View nateraw's full-sized avatar
💯

Nathan Raw nateraw

💯
View GitHub Profile
@nateraw
nateraw / gemini_audio_captioning.py
Last active July 10, 2025 18:50
Gemini audio captioning
import io, os
from pathlib import Path
import torchaudio
from google import genai
from pydantic import BaseModel
# If in colab...
# from google.colab import userdata
# os.environ["GOOGLE_API_KEY"] = userdata.get('GOOGLE_API_KEY')
@nateraw
nateraw / songstarter-v0-2-demo.ipynb
Last active April 13, 2024 21:11
songstarter-v0-2-demo.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file has been truncated, but you can view the full file.
{"text":"[INST] <<SYS>>\nUse the Input to provide a summary of a conversation.\n<<\/SYS>>\n\nInput:\nAmanda: I baked cookies. Do you want some?\r\nJerry: Sure!\r\nAmanda: I'll bring you tomorrow :-) [\/INST]\n\nSummary: Amanda baked cookies and will bring Jerry some tomorrow."}
{"text":"[INST] <<SYS>>\nUse the Input to provide a summary of a conversation.\n<<\/SYS>>\n\nInput:\nOlivia: Who are you voting for in this election? \r\nOliver: Liberals as always.\r\nOlivia: Me too!!\r\nOliver: Great [\/INST]\n\nSummary: Olivia and Olivier are voting for liberals in this election. "}
@nateraw
nateraw / run.py
Created June 27, 2023 07:57
Use Modal for Stable Diffusion QR Code Generation
import io
import time
from pathlib import Path
from modal import Image, Stub, method
stub = Stub("stable-diffusion-qrcode-cli")
cache_dir = "/vol/cache"
@nateraw
nateraw / rit-demo-stable_diffusion_videos.ipynb
Last active April 7, 2023 19:40
rit-demo-stable_diffusion_videos.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nateraw
nateraw / sdv-sd2-1-example.ipynb
Created February 18, 2023 23:55
sdv-SD2-1-example.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nateraw
nateraw / audioldm.ipynb
Last active February 3, 2023 16:30
audioldm.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nateraw
nateraw / ai_or_not_baseline_timm_datasets_lightning.ipynb
Last active June 24, 2024 20:50
ai_or_not_baseline_timm_datasets_lightning.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nateraw
nateraw / download_musiccaps.py
Created January 27, 2023 21:58
Download the underlying audio files of the MusicCaps dataset from YouTube using Hugging Face datasets
"""
Download the clips within the MusicCaps dataset from YouTube.
Requires:
- ffmpeg
- yt-dlp
- datasets[audio]
- torchaudio
"""
import subprocess
@nateraw
nateraw / albumentations-depth-set-transform-issue.ipynb
Last active January 3, 2023 20:45
albumentations-depth-set-transform-issue.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.