Skip to content

Instantly share code, notes, and snippets.

@Artefact2
Artefact2 / README.md
Last active July 3, 2024 13:40
GGUF quantizations overview

Which GGUF is right for me? (Opinionated)

Good question! I am collecting human data on how quantization affects outputs. See here for more information: ggerganov/llama.cpp#5962

In the meantime, use the largest that fully fits in your GPU. If you can comfortably fit Q4_K_S, try using a model with more parameters.

llama.cpp feature matrix

See the wiki upstream: https://github.com/ggerganov/llama.cpp/wiki/Feature-matrix

@adam-hanna
adam-hanna / systemd-cloudwatch-logs-tutorial.md
Last active June 12, 2024 04:04
Forward systemd service logs to AWS Cloudwatch

Introduction

I often find myself ssh'ing into my servers and checking my systemd service logs with $ journalctl -f -u {name}.service. One day I got tired of this and wanted all of my important logs in once place (Amazon AWS Cloudwatch). To my dismay, there weren't any real good tutorials on how to do so. So, voilà.

Steps

Overall, it's a fairly simple process consisting of the following few steps.

1. Modify the service file

Open the service file with $ sudo vi /lib/systemd/system/{name}.service

Modify the [Service] section:

@cjgiridhar
cjgiridhar / nested_maps.go
Created February 18, 2019 16:23
Nested Maps in Golang
package main
import "fmt"
func main() {
// shoppingList is a map that has a map inside it
shoppingList := make(map[string]map[string]int)
// veggies key points to veggiesMap
veggiesMap := map[string]int{"onion": 2, "orka": 3}
@qpwo
qpwo / monte_carlo_tree_search.py
Last active June 16, 2024 08:37
Monte Carlo tree search (MCTS) minimal implementation in Python 3, with a tic-tac-toe example gameplay
"""
A minimal implementation of Monte Carlo tree search (MCTS) in Python 3
Luke Harold Miles, July 2019, Public Domain Dedication
See also https://en.wikipedia.org/wiki/Monte_Carlo_tree_search
https://gist.github.com/qpwo/c538c6f73727e254fdc7fab81024f6e1
"""
from abc import ABC, abstractmethod
from collections import defaultdict
import math
@dnozay
dnozay / main.py
Created November 1, 2014 23:53
python multi-processing example using initializer function.
#!/usr/bin/env python
# This example shows how to use multiprocessing with an initializer function.
# We take advantage of that to make the workers each have a custom initial
# load. And in particular example, we will make the workers sleep.
# Because we make them sleep different amounts, one of them is going to be
# ready much before the others, and thus we can guess easily which worker
# will do most of the work.
#
# see https://stackoverflow.com/questions/26693797/python-multiprocessing-process-number
@aras-p
aras-p / preprocessor_fun.h
Last active June 21, 2024 12:20
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,