Skip to content

Instantly share code, notes, and snippets.

@svpino
svpino / file.py
Created June 16, 2023 13:19
OpenAI's API undocumented function calling python
import openai
openai.api_key = "YOUR KEY GOES HERE"
def get_completion(messages):
response = openai.ChatCompletion.create(
model="gpt-3.5-turbo-0613",
messages=messages,
functions=[{
"name": "fake",
@srikumarks
srikumarks / mandel.jl
Last active May 18, 2023 15:02
Julia mandelbrot for benchmarking against Python/Mojo
function mandelbrot_kernel(c, max_iter)
z = c
for i in 1:max_iter
z = z * z + c
if abs2(z) > 4
return i-1
end
end
return max_iter
@eugeneyan
eugeneyan / mandelbrot-mojo.md
Last active April 4, 2024 15:52
Benchmarking Mojo vs. Python on Mandelbrot sets

Mandelbrot in Mojo with Python plots

Not only Mojo is great for writing high-performance code, but it also allows us to leverage huge Python ecosystem of libraries and tools. With seamless Python interoperability, Mojo can use Python for what it's good at, especially GUIs, without sacrificing performance in critical code. Let's take the classic Mandelbrot set algorithm and implement it in Mojo.

We'll introduce a Complex type and use it in our implementation.

Mandelbrot in python

@shawwn
shawwn / llama_65b_data.txt
Last active March 13, 2023 15:17
(Generated by LLaMA 65B)
I am Lieutenant Commander Data, and I am an android.
I was created by Doctor Soong in the mid-2300s on Earth's moon colony.
My positronic brain is a network of trillions of interconnected
neurons that allow me to experience consciousness and sentience as
only living beings can—and yet my mind operates at speeds far greater
than those of most unenhanced organics. This makes it possible for me
to perform complex analyses almost instantaneously while
simultaneously running thousands of background processes without any
decrease in efficiency or awareness. It also lets me communicate with
@veekaybee
veekaybee / README.md
Last active December 6, 2024 19:08
whisper.ipynb

Using Whisper to transcribe audio

This episode of Recsperts was transcribed with Whisper from OpenAI, an open-source neural net trained on almost 700 hours of audio. The model includes an encoder-decoder architecture by tokenizing audio into 30-second chunks, normalizing audio samples to the log-Mel scale, and passing the data into an encoder. A decoder is trained to predict the captioned text matching the encoder, and the model includes transcription, as well as timestamp-aligned transcription, and multilingual translation.

Screen Shot 2023-01-29 at 11 09 57 PM

The transcription process outputs a single string file, so it's up to the end-user to parse out individual speakers, or run the model [through a sec

@Wazzabeee
Wazzabeee / test_simple.tex
Created January 21, 2023 00:40
LaTeX code generated from test_simple.py using PlotNeuralNet package
\documentclass[border=8pt, multi, tikz]{standalone}
\usepackage{import}
\subimport{../layers/}{init}
\usetikzlibrary{positioning}
\usetikzlibrary{3d} %for including external image
\def\ConvColor{rgb:yellow,5;red,2.5;white,5}
\def\ConvReluColor{rgb:yellow,5;red,5;white,5}
\def\PoolColor{rgb:red,1;black,0.3}
\def\UnpoolColor{rgb:blue,2;green,1;black,0.3}
@cheadrian
cheadrian / !Huawei Ads and Tracking Blocking.md
Last active June 22, 2024 21:57
Adaway Huawei Blocklist for Ads, Tracking, Metrics, Gspace
@sammcj
sammcj / github_repo_settings.md
Created November 20, 2022 00:36
trying out upg

"typescript" "manage and configure a list of Github repositories and their settings including branch protection rules"

$ upg

    __  ______  ____ _    UPG CLI
   / / / / __ \/ __ `/    Public Beta
  / /_/ / /_/ / /_/ /
 \__,_/ .___/\__, / 🇺🇸 Built by GPT Labs
@chasemc
chasemc / skimr.r
Created September 20, 2022 18:26
library(data.table)
library(skimr)
temp <- fread(
"curl -s https://ftp.ncbi.nlm.nih.gov/genomes/ASSEMBLY_REPORTS/assembly_summary_genbank.txt | head -n 20",
sep = "\t",
header = T
)
skim(temp)