This file contains 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 flask import Flask, request, jsonify, send_file | |
import tempfile | |
import whisper | |
import gtts | |
import os | |
from openai import OpenAI | |
client = OpenAI() | |
conversation = [] |
This file contains 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
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 |
This file contains 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
!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') |
This file contains 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
import wandb | |
# 1: Define objective/training function | |
def objective(config): | |
score = config.x ** 3 + config.y | |
return score | |
def main(): | |
wandb.init(project='my-first-sweep') | |
score = objective(wandb.config) |
This file contains 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
import numpy as np | |
import torch | |
import torch.nn as nn | |
import numpy as np | |
import panel as pn | |
from ipywidgets import widgets | |
from ipywidgets import interact, interactive, fixed, interact_manual | |
from IPython.display import display | |
import holoviews as hv |
This file contains 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
import numpy as np | |
import panel as pn | |
import holoviews as hv | |
hv.extension("bokeh") | |
# hv.extension('matplotlib') | |
from holoviews.streams import Stream, Params | |
from scipy.io import wavfile | |
from scipy.signal import spectrogram | |
rate, data = wavfile.read('/filepath.wav') |
This file contains 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
## See this blog for original post about jp_proxy_widget and wavesurfer.js https://blog.ouseful.info/2020/01/11/rapid-widget-prototyping-using-third-party-javascript-packages-in-jupyter-notebooks/ | |
import jp_proxy_widget | |
import ipywidgets as widgets | |
widget = jp_proxy_widget.JSProxyWidget() | |
js = "https://unpkg.com/wavesurfer.js" | |
js2="https://unpkg.com/wavesurfer.js/dist/plugin/wavesurfer.spectrogram.min.js" | |
url = "https://ia902606.us.archive.org/35/items/shortpoetry_047_librivox/song_cjrg_teasdale_64kb.mp3" |
This file contains 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 ipywidgets import IntSlider, ToggleButton, Text | |
from IPython.display import display, Audio, Javascript | |
from scipy.io import wavfile | |
import numpy as np | |
from matplotlib import pyplot as plt | |
import ipywidgets | |
t = Text(value='0', | |
description='Elapsed Time:', | |
style = {'description_width': 'initial'}, |
This file contains 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
import scipy.io as sio | |
import numpy as np | |
import os | |
import gc | |
import six.moves.urllib as urllib | |
import cv2 | |
import time | |
import xml.etree.cElementTree as ET | |
import random | |
import shutil as sh |
This file contains 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
# -------------------------------------------------------- | |
# Camera sample code for Tegra X2/X1 | |
# | |
# This program could capture and display video from | |
# IP CAM, USB webcam, or the Tegra onboard camera. | |
# Refer to the following blog post for how to set up | |
# and run the code: | |
# https://jkjung-avt.github.io/tx2-camera-with-python/ | |
# | |
# Written by JK Jung <[email protected]> |
NewerOlder