Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.
brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aac --with-opus
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
# This is a modified version of TRL's `SFTTrainer` example (https://github.com/huggingface/trl/blob/main/examples/scripts/sft_trainer.py), | |
# adapted to run with DeepSpeed ZeRO-3 and Mistral-7B-V1.0. The settings below were run on 1 node of 8 x A100 (80GB) GPUs. | |
# | |
# Usage: | |
# - Install the latest transformers & accelerate versions: `pip install -U transformers accelerate` | |
# - Install deepspeed: `pip install deepspeed==0.9.5` | |
# - Install TRL from main: pip install git+https://github.com/huggingface/trl.git | |
# - Clone the repo: git clone github.com/huggingface/trl.git | |
# - Copy this Gist into trl/examples/scripts | |
# - Run from root of trl repo with: accelerate launch --config_file=examples/accelerate_configs/deepspeed_zero3.yaml --gradient_accumulation_steps 8 examples/scripts/sft_trainer.py |
You can run this app by following the steps below:
identity.basic
& identity.email
to User Token Scopes# ---------------------------------------------------------- | |
# Configuration for hosting Git repositories with Apache 2.x | |
# ---------------------------------------------------------- | |
# | |
# This setup provides "dual URLS", where URL like <http://git.example.com/my_repository.git> | |
# loads Gitweb in the browser and the same URL can be used in commands like `git clone` and `git remote add`. | |
# It was compiled from some sources on the internet and further customized/tuned. | |
# | |
# Please see documentation for: | |
# |
This script will load any stackoverflow site from the XML dump (retrievable at https://archive.org/details/stackexchange via torrent) into Elasticsearch.
To use just call:
python load_stack.py PATH
/* | |
This snippet is an example of backpressure implementation in Go. | |
It doesn't run in Go Playground, because it starts an HTTP Server. | |
The example starts an HTTP server and sends multiple requests to it. The server starts denying | |
requests by replying an "X" (i.e. a 502) when its buffered channel reaches capacity. | |
This is not the same as rate-limiting; you might be interested in https://github.com/juju/ratelimit | |
or https://godoc.org/golang.org/x/time/rate. |
In researching topics for RailsCasts I often read code in Rails and other gems. This is a great exercise to do. Not only will you pick up some coding tips, but it can help you better understand what makes code readable.
A common practice to organize code in gems is to divide it into modules. When this is done extensively I find it becomes very difficult to read. Before I explain further, a quick detour on instance_eval
.
You can find instance_eval
used in many DSLs: from routes to state machines. Here's an example from Thinking Sphinx.
class Article < ActiveRecord::Base
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Hash large File Example</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/asmCrypto/0.22.0/asmcrypto.min.js"></script> | |
<script type="text/javascript" language="javascript"> | |
function on_hash_done(hash, time_elapsed_seconds) { | |
document.getElementById('progress').innerText = ''; |
.DS_Store | |
Gemfile.lock | |
*.pem | |
node.json | |
tmp/* | |
!tmp/.gitignore |