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
@rain-1
rain-1 / llama-home.md
Last active November 9, 2024 03:49
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.
@eggplants
eggplants / build_vte_head.sh
Last active March 6, 2024 17:53
On Ubuntu 21.04, this script enables gnome-terminal to show sixel images. (Ref: https://www.kofuk.org/blog/20210803-vte-sixel/, https://twitter.com/man_2_fork/status/1422514528886030337?s=19 )
#!/usr/bin/env -S bash -e
# REPO='https://gitlab.gnome.org/GNOME/vte.git'
REPO='https://github.com/GNOME/vte.git'
LIBPATH='/usr/local/lib/x86_64-linux-gnu'
LDCONFPATH='/etc/ld.so.conf'
# See Deps:
# https://github.com/GNOME/vte/blob/master/meson.build
# On Ubuntu 21.04, GNOME-Terminal 3.38.1:
@bartman
bartman / watch-cgroup-memory-usage
Last active November 17, 2021 15:19
watch-cgroup-memory-usage
#!/bin/bash
#
# watch cgroup 'browsers' memory activity
#
# best served with ...
#
# https://gist.github.com/jakewarren/477ecd1149abe908cbd5cf7a7c9abaa3
self=$0
SUDO=
@meskarune
meskarune / cal.lua
Last active June 11, 2024 12:31
conky calendar and weather
#!/usr/bin/env lua
conky_color = "${color1}%2d${color}"
t = os.date('*t', os.time())
year, month, currentday = t.year, t.month, t.day
daystart = os.date("*t",os.time{year=year,month=month,day=01}).wday
month_name = os.date("%B")
@probonopd
probonopd / DIDL-Lite
Last active April 17, 2020 00:54
Play a YouTube video on a Samsung Smart TV using UPNP
<?xml version="1.0" encoding="UTF-8"?>
<DIDL-Lite xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sec="http://www.sec.co.kr/" xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/">
<item id="f-0" parentID="0" restricted="0">
<dc:title>Video</dc:title>
<dc:creator>vGet</dc:creator>
<upnp:class>object.item.videoItem</upnp:class>
<res protocolInfo="http-get:*:video/mp4:DLNA.ORG_OP=01;DLNA.ORG_CI=0;DLNA.ORG_FLAGS=01700000000000000000000000000000" sec:URIType="public">$URI</res>
</item>
</DIDL-Lite>
@niw
niw / libpng_test.c
Last active September 3, 2024 18:38
How to read and write PNG file using libpng. Covers trivial method calls like png_set_filler.
/*
* A simple libpng example program
* http://zarb.org/~gc/html/libpng.html
*
* Modified by Yoshimasa Niwa to make it much simpler
* and support all defined color_type.
*
* To build, use the next instruction on OS X.
* $ brew install libpng
* $ clang -lz -lpng16 libpng_test.c
@jordansissel
jordansissel / output
Created July 19, 2011 16:05
libxdo and WM_CLASS
% ./a.out $WINDOWID
Items: 22
Type: STRING
WM_CLASS[0]: terminator
WM_CLASS[1]: Terminator