Skip to content

Instantly share code, notes, and snippets.

View scottire's full-sized avatar

Scott Condron scottire

View GitHub Profile
!curl -O https://calmcode.io/datasets/pokemon.json
import pandas
import weave
from weave.ecosystem import openai
from weave.ecosystem import umap
from weave.ecosystem import hdbscan
raw_data = pandas.read_json('./pokemon.json')
@scottire
scottire / client.py
Created December 10, 2023 17:13
VAD and record audio
import pyaudio
import wave
import requests
import os
import sys
import webrtcvad
def record_audio(filename, duration=5):
vad = webrtcvad.Vad(1) # Set aggressiveness from 0 to 3
sample_rate = 16000 # Sample rate suitable for VAD
@scottire
scottire / app.py
Created December 10, 2023 17:15
Transcribe, ChatGPT, gTTS
from flask import Flask, request, jsonify, send_file
import tempfile
import whisper
import gtts
import os
from openai import OpenAI
client = OpenAI()
conversation = []