Skip to content

Instantly share code, notes, and snippets.

# to use this, first install python and exllamav2 (https://github.com/turboderp/exllamav2)
# load a model, rearrange the layers as you like, set generation parameters, and chat with it
# duplicate layers need no extra memory
# WARNING: duplicate layers share the same cache, even though they shouldn't.
# This makes the model even more demented than a frankenmerge - use at your own risk.
# public domain - Silphendio
import copy
import math
import random
@dnhkng
dnhkng / cache_test.py
Created January 14, 2024 11:12
Testing the cache
# to use this, first install python and exllamav2 (https://github.com/turboderp/exllamav2)
# load a model, rearrange the layers as you like, set generation parameters, and chat with it
# duplicate layers need no extra memory
# WARNING: duplicate layers share the same cache, even though they shouldn't.
# This makes the model even more demented than a frankenmerge - use at your own risk.
# public domain - Silphendio
import random
import sys
['Nigeria: Director General National Emergency Management Agency (NEMA) flags off Distribution of Relief items and livelihood support items in Jigawa state', '412 words', '25 September 2023']
{"primary_classification":"H", "event_type":"NNC" }
['Rescued from the earthquake in Morocco, midwife Maria delivers babies and saves lives as catastrophe unfolds around her', '629 words', '25 September 2023']
{"primary_classification":"G", "event_type":"EQ"}
['Two Qatari Planes from Qatari Air Bridge Arrive at Benina Airport in Libya to Aid Flood-Hit People', '192 words', '25 September 2023']
{"primary_classification":"H", "event_type":"F"}

Ubuntu 22.04 for Deep Learning

In the name of God

This gist contains steps to setup Ubuntu 22.04 for deep learning.


Install Ubuntu 22.04

@dnhkng
dnhkng / gist:54caad1757854b849fa2c0707fc455d5
Created December 4, 2021 13:12
Ppython3.9 in Dockers
# avoid setting the timezone during installation in a docker
apt update
DEBIAN_FRONTEND="noninteractive"
TZ="Europe/Berlin"
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
apt install python3.9 -y