Skip to content

Instantly share code, notes, and snippets.

View trappedinspacetime's full-sized avatar
🏠
Working from home

Kenn trappedinspacetime

🏠
Working from home
  • For Personal Use
  • Istanbul
View GitHub Profile
May 26 12:28:44 whatnext kernel: Linux version 5.15.0-72-generic (buildd@lcy02-amd64-035) (gcc (Ubuntu 11.3.0-1ubuntu1~22.04.1) 11.3.0, GNU ld (GNU Binutils for Ubuntu) 2.38) #79-Ubuntu SM>
May 26 12:28:44 whatnext kernel: Command line: BOOT_IMAGE=/boot/vmlinuz-5.15.0-72-generic root=UUID=0306af66-cc5a-4dfd-852b-674e234f84aa ro quiet splash vt.handoff=7
May 26 12:28:44 whatnext kernel: KERNEL supported cpus:
May 26 12:28:44 whatnext kernel: Intel GenuineIntel
May 26 12:28:44 whatnext kernel: AMD AuthenticAMD
May 26 12:28:44 whatnext kernel: Hygon HygonGenuine
May 26 12:28:44 whatnext kernel: Centaur CentaurHauls
May 26 12:28:44 whatnext kernel: zhaoxin Shanghai
May 26 12:28:44 whatnext kernel: x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers'
May 26 12:28:44 whatnext kernel: x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers'
@trappedinspacetime
trappedinspacetime / llama-home.md
Created May 14, 2023 19:56 — forked from rain-1/llama-home.md
How to run Llama 13B with a 6GB graphics card

This worked on 14/May/23. The instructions will probably require updating in the future.

llama is a text prediction model similar to GPT-2, and the version of GPT-3 that has not been fine tuned yet. It is also possible to run fine tuned versions (like alpaca or vicuna with this. I think. Those versions are more focused on answering questions)

Note: I have been told that this does not support multiple GPUs. It can only use a single GPU.

It is possible to run LLama 13B with a 6GB graphics card now! (e.g. a RTX 2060). Thanks to the amazing work involved in llama.cpp. The latest change is CUDA/cuBLAS which allows you pick an arbitrary number of the transformer layers to be run on the GPU. This is perfect for low VRAM.

  • Clone llama.cpp from git, I am on commit 08737ef720f0510c7ec2aa84d7f70c691073c35d.
@trappedinspacetime
trappedinspacetime / diarise.py
Created November 10, 2022 15:06 — forked from lmmx/diarise.py
Python commands to create speaker diarisation
# ffmpeg -i foo.m4a foo.wav
from pyannote.audio import Pipeline
pipeline = Pipeline.from_pretrained("pyannote/speaker-diarization")
diarization = pipeline("foo.wav")
# RTTM format https://catalog.ldc.upenn.edu/docs/LDC2004T12/RTTM-format-v13.pdf
with open("foo.rttm", "w") as rttm:
diarization.write_rttm(rttm)
@trappedinspacetime
trappedinspacetime / Makefile
Created November 5, 2022 15:04 — forked from mertyildiran/Makefile
transregion: X11 SHAPE extension input region demo
# Makefile for transregion
CFLAGS = -g
LDFLAGS = -L/usr/X11R6/lib -lXpm -lXext -lX11 -lm
all: transregion
transregion: transregion.o
$(CC) -o transregion transregion.o $(LDFLAGS)
@trappedinspacetime
trappedinspacetime / cairo_example.c
Created October 21, 2022 17:05 — forked from ryanflannery/cairo_example.c
Problem in cairo + xcb where alpha blending is cumulative (becoming more opaque with each render)
/*
* NOTE: This is a little long because I'm including all XCB setup I have
* (including handling tiling window managers). It's below the main cairo logic
* for ease, but included for posterity. This is a subset of a larger program
* I'm working on.
*
* WHAT THIS IS:
* A sample program illustrating a problem I'm having with cairo/xcb, where I
* want to have a window that supports transparency (alpha channel) for the
* background color, and other components, with a regular re-draw cycle
@trappedinspacetime
trappedinspacetime / build_lm.sh
Created October 16, 2022 19:57 — forked from goodmami/build_lm.sh
Ngrams, LMs, and Perplexity in AWK and sed
#!/bin/bash
ngram_count_file="$1"
lm_file="$2"
awk -v f="$ngram_count_file"\
'function log10(x){ return log(x)/log(10.0) }
BEGIN {
while (getline < f) {
if(/[0-9]+\t[^ ]+$/) { type[1]++; token[1]=token[1]+$1 }
@trappedinspacetime
trappedinspacetime / countdown.py
Created May 22, 2022 10:57
all in all pycairo example
#!/usr/bin/python3
################################################################################
##3456789 123456789 123456789 123456789 123456789 123456789 123456789 123456789
##
## Info:
## python-port of cairo-based countdown effect
##
## Run:
## chmod +x countdown.py
#!/usr/bin/env python3
# taken from https://github.com/s-zeid/bin/blob/main/display-transparent
"""Displays an image without a window border or background.
Based on code from http://bit.ly/qfvule
"""
import argparse
import os
@trappedinspacetime
trappedinspacetime / limitcpu.sh
Created May 5, 2022 20:08
limit chromium cpu
while true; do cpulimit -p $( while true ; do if [[ ! -z $(pstree -p -a | awk '/chromium-browser/ && !/awk/' | grep -oP "(?<=sh,).*[0-9]+") ]]; then echo "$(pstree -p -a | awk '/chromium-browser/ && !/awk/' | grep -oP "(?<=sh,).*[0-9]+")"; break; fi; sleep 2; done ) -l 60; done
@trappedinspacetime
trappedinspacetime / prayer_times_tr.py
Created April 20, 2022 13:06
prayer times close to Turkish Diyanet's calculation
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import math
import re
import pytz
import datetime
from datetime import datetime as dt
from datetime import datetime as dtm, time as datetime_time, timedelta
#from _datetime import *
"""