This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
train: | |
- input: |- | |
🔵 🔴 🟢 ⚫️ ⚫️ ⚫️ ⚫️ | |
🔴 🟢 ⚫️ ⚫️ ⚫️ ⚫️ ⚫️ | |
🟢 ⚫️ ⚫️ ⚫️ ⚫️ ⚫️ ⚫️ | |
⚫️ ⚫️ ⚫️ ⚫️ ⚫️ ⚫️ ⚫️ | |
⚫️ ⚫️ ⚫️ ⚫️ ⚫️ ⚫️ ⚫️ | |
⚫️ ⚫️ ⚫️ ⚫️ ⚫️ ⚫️ ⚫️ | |
⚫️ ⚫️ ⚫️ ⚫️ ⚫️ ⚫️ ⚫️ | |
output: |- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pathlib import Path | |
from os import environ | |
from time import sleep | |
from textwrap import dedent | |
import nestedtext as nt | |
import httpx | |
import arrow | |
API_KEY = environ.get('ANTHROPIC_API_KEY', None) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# PS1 etc requires wrapping non-printing characters | |
_np() { echo -ne "\[$1\]" ; } | |
# Generating ANSI escape codes | |
esc() { echo -ne "\e[$1m" ; } ; _esc() { _np "$(esc $1)" ; } | |
# Set foreground / background R G B (0-5 each) | |
rgb() { esc "$1;5;$((16 + 36 * $2 + 6 * $3 + $4))" ; } # FG/BG r g b | |
fg() { rgb 38 $@ ; } ; _fg() { _np "$(rgb 38 $@)" ; } |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
# 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') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
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: | |
``` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.