Skip to content

Instantly share code, notes, and snippets.

View ggerganov's full-sized avatar
🦙
🦙 🦙

Georgi Gerganov ggerganov

🦙
🦙 🦙
View GitHub Profile
@ggerganov
ggerganov / llama-7B.ggml
Created June 4, 2023 17:49
LLaMA 7B ggml computation graph
20:47:34 ▶ metal ▶ 12⎘ ▶ $ ▶ ./bin/main -m ../models/7B/ggml-model-q4_0.bin --export
main: build = 652 (b252acb)
main: seed = 1685900854
llama.cpp: loading model from ../models/7B/ggml-model-q4_0.bin
llama_model_load_internal: format = ggjt v3 (latest)
llama_model_load_internal: n_vocab = 32000
llama_model_load_internal: n_ctx = 512
llama_model_load_internal: n_embd = 4096
llama_model_load_internal: n_mult = 256
llama_model_load_internal: n_head = 32
@ggerganov
ggerganov / generate.sh
Last active November 4, 2022 19:24
Transcribe mic audio using Whisper
#!/bin/bash
# record some raw audio
sox -d rec.wav
# resample to 16kHz
ffmpeg -y -i ./rec.wav -ar 16000 -ac 1 -c:a pcm_s16le ./rec16.wav > /dev/null 2>&1
# run Whisper
echo "Processing ..."
@ggerganov
ggerganov / fix-opera-ffmpeg.sh
Last active June 27, 2022 10:27
Fix Opera ffmpeg
#!/bin/bash
#sudo cp -v /usr/lib/slack/libffmpeg.so /usr/lib/x86_64-linux-gnu/opera/
sudo snap install chromium-ffmpeg
sudo cp -v /snap/chromium-ffmpeg/current/chromium-ffmpeg-107578/chromium-ffmpeg/libffmpeg.so /usr/lib/x86_64-linux-gnu/opera/libffmpeg.so
@ggerganov
ggerganov / iss-docking.js
Created May 16, 2020 12:30
Automatic ISS Docking in Javascript
// Auto-pilot for docking with the International Space Station
//
// The program uses Artificial Intelligence and Decision Trees (i.e. basic kinematics and a bunch of if statements)
// to perform docking with the ISS from any starting position.
//
// To use it:
// - open the SpaceX simulation website: https://iss-sim.spacex.com/
// - open the Developer's console and paste the contents of this file
//
// Demo: https://youtu.be/jWQQH2_UGLw
@ggerganov
ggerganov / config
Last active March 7, 2020 13:49
i3/config
# custom config
workspace_layout tabbed
bindsym $mod+d exec rofi -show run
# Pulse Audio controls
bindsym XF86AudioRaiseVolume exec --no-startup-id pactl set-sink-volume 0 +5% #increase sound volume
bindsym XF86AudioLowerVolume exec --no-startup-id pactl set-sink-volume 0 -5% #decrease sound volume
bindsym XF86AudioMute exec --no-startup-id pactl set-sink-mute 0 toggle # mute sound
@ggerganov
ggerganov / font.sh
Created March 7, 2020 08:44
Font - Source Code Pro Regular
#/bin/bash
git clone --depth 1 --branch release https://github.com/adobe-fonts/source-code-pro.git ~/.fonts/adobe-fonts/source-code-pro
sudo fc-cache -f -v ~/.fonts/adobe-fonts/source-code-pro
@ggerganov
ggerganov / config-i3.sh
Last active March 7, 2020 07:51
config-i3
#/bin/bash
# swap monitors
xrandr --output HDMI-0 --right-of DP-0
# change keyboard speed
xset r rate 150 100
# fix audio
start-pulseaudio-x11
@ggerganov
ggerganov / qutebrowser.txt
Last active March 6, 2020 08:55
qutebrowser config
:set url.default_page https://google.com/
:set url.searchengines '{"DEFAULT": "https://google.com/search?q={}"}'
:set content.headers.user_agent 'Mozilla/5.0 (X11; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0 https://accounts.google.com/*'
@ggerganov
ggerganov / file_download_multi.cmake
Last active March 16, 2019 17:57
CMake macro for downloading from a list of possible remote locations
# MIT License
# http://opensource.org/licenses/MIT
#
# Copyright (c) 2019 Georgi Gerganov
#
# file_download_multi
#
# Try to download a file from a list of possible remote location (URLs)
# The macro loops through the list and attempts to download using
# the standard file(DOWNLOAD ...) function.