Skip to content

Instantly share code, notes, and snippets.

View p-i-'s full-sized avatar

Pi p-i-

View GitHub Profile
@p-i-
p-i- / rt_speech_chunker.py
Last active April 17, 2024 15:45
Realtime (Ultralow-latency) Speech Chunker using Voice Activity Detection (VAD) using WebRTC VAD
'''
# Realtime (Ultralow-latency) Voice Activity Detection (VAD) using WebRTC VAD
v3.2
π 17 Apr 2024
## Usage
```python
def on_segment(segment): # np.array of np.int16
print(f'☏ CALLBACK: Got segment: {len(segment)} frames')
@p-i-
p-i- / macos_realtime_stt__whisper.py
Created April 15, 2024 20:12
macOS Realtime Speech-To-Text using Whisper (locally)
'''
Adapted by π 15 Apr 2024
from https://github.com/davabase/whisper_real_time/blob/master/transcribe_demo.py
... which appears to have been itself pilfered from:
https://github.com/JihyeokKim/whisper_ros/tree/master/whisper_ros/src
To run on macOS:
- `brew install ffmpeg portaudio`
- Create requirements.txt:
```
@p-i-
p-i- / image-edit.ipynb
Created March 28, 2024 21:38
Demonstration (failing) of openAI's image-edit API
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@p-i-
p-i- / x.ipynb
Created November 23, 2023 16:02
FFF Naive PyTorch impl (3x slower than nn.Linear)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@p-i-
p-i- / x.ipynb
Created November 23, 2023 16:01
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@p-i-
p-i- / vae.ipynb
Created November 12, 2023 19:02
Simple Variational Autoencoder over MNIST
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@p-i-
p-i- / spack--bootstrap-gcc.md
Created November 4, 2023 23:32
use spack to bootstrap gcc

🟢 Do all spack installs on a worker node This way it's compiling for the architecture that will be RUNNING these programs

$ srun --pty --cpus-per-task=32 --mem=64G --time=08:00:00 --partition=gpu --gres=gpu:0 /bin/bash

🟢 Clone spack (taken from their README.md) I'm installing into /path/to/spack, so spack will be /path/to/spack/spack

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.