Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
setup () {
# Install xcode
sudo xcodebuild -license
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
mise use -g [email protected]
pip install -e .
git clone https://github.com/ggerganov/whisper.cpp.git
cd whisper.cpp
cmake -B build -DWHISPER_COREML=1
@se4u
se4u / gist:507270f0e587e9a430c19f351dcd6ce3
Created January 29, 2025 11:10 — forked from ykk648/gist:cf7bf2b64897c29cfb0c67003bbbbea3
GPT-4 Architecture, Infrastructure, Training Dataset, Costs, Vision, MoE
2023/7/11 08:59
GPT-4 Architecture, Infrastructure, Training Dataset, Costs, Vision, MoE
GPT-4 Architecture, Infrastructure,
Training Dataset, Costs, Vision, MoE
Demystifying GPT-4: The engineering tradeoffs that led OpenAI to their
architecture.
DYLAN PATEL AND GERALD WONG
2023 年 7 月 11 日 ∙ PAID
38
8
@se4u
se4u / bluetooth_kivy.py
Created January 12, 2020 00:44 — forked from cuibonobo/bluetooth_kivy.py
Bluetooth example with Kivy. A more fleshed-out example here: https://github.com/tito/android-demo. A more modern way of doing it: https://github.com/kivy/plyer. And this guy used Kivy to connect to an Arduino: https://github.com/brean/arduino-kivy-bluetooth. Native Kivy code (?): https://groups.google.com/d/msg/kivy-users/n_cMbFzf_1A/5edKgQgycx0J
# Same as before, with a kivy-based UI
'''
Bluetooth/Pyjnius example
=========================
This was used to send some bytes to an arduino via bluetooth.
The app must have BLUETOOTH and BLUETOOTH_ADMIN permissions (well, i didn't
tested without BLUETOOTH_ADMIN, maybe it works.)
@se4u
se4u / effective_sample_size.py
Created December 22, 2019 22:39
Simulate effective sample size computation to check the example given in "Lessors from Contextual Bandit Learning in a Customer Support Bot" by Karampatziakis et al.
import numpy as np
k = 20
eps = 0.1
eps2 = 0.5
w = []
n = 100000
for i in range(n):
rule = np.random.choice(k)
eps_greedy_action = rule if np.random.rand() > eps else np.random.choice(k)
@se4u
se4u / pymeta.py
Created August 13, 2019 07:18
Example of python meta programming by modifying the token sequence output by the inbuilt tokenizer and codecs used for python parsing.
## --- Save this file as pymeta.py ---- ##
# inspired by pyxl and github.com/SyrusAkbary/interpy
# >> import pymeta
# >> print(codecs.decode("1\n2", encoding='pymeta'))
# 1
# import time; print(time.time());
# 2
## ---------------------- ##
from six import StringIO
import codecs, tokenize, encodings
@se4u
se4u / expt.sh
Created January 3, 2019 20:43
Nevergrad Experiment and Benchmark Script
#!/bin/bash
FNC=${1-2clsp}
PFX=${2-echo}
2clsp () {
$PFX rsync -av ../nevergrad clsp:~/project/
}
2mac () {
$PFX rsync -av clsp:~/project/nevergrad/nevergrad/optimization/recorded_recommendations.csv nevergrad/optimization/
@se4u
se4u / foo.ipynb
Last active November 6, 2018 21:29
Some experiments to understand the performance of Adam algorithm on sparse inputs such as spike trains
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@se4u
se4u / localaptget.sh
Last active September 30, 2018 21:43
apt-get packages without sudo and use by overriding LD_PRELOAD or LD_LIBRARY_PATH
## https://askubuntu.com/a/423555/625555
## There is also libapt, and python-dpkg and other packages that
## can talk to ubuntu package managers.
name=libqt5sql5
CMDPFX=echo
DEPS="$(apt-cache depends $name | grep Depends | awk '{print $2}')"
i=0
while [[ $i < ${#DEPS} ]] ; do
i=$(( i + 1 ))
# dpkg -s libpng16-16 | grep Status | wc -l
@se4u
se4u / .flake8rc
Created June 3, 2018 18:41
My pyflakes config file
[flake8]
ignore = E226,E302,E41,E402,E261,E305,E111,E121,E401,E701,W501,C901,W503,E266,E114,E228,E722,E741
max-line-length = 120
exclude = tests/*
max-complexity = 10
@se4u
se4u / .latexmkrc
Created June 3, 2018 18:40
My latex make config file
$pdf_previewer = 'open -a Skim';
$pdflatex = 'pdflatex -synctex=1 -interaction=nonstopmode ';
$pdf_mode = 1;
## $out_dir = 'build';
@generated_exts = (@generated_exts, 'synctex.gz');