Skip to content

Instantly share code, notes, and snippets.

View stuaxo's full-sized avatar
💭
 

Stuart Axon stuaxo

💭
 
View GitHub Profile
@yoavg
yoavg / instruct-to-not-hallucinate.md
Created September 9, 2024 20:23
Is telling a model to "not hallucinate" absurd?

Is telling a model to "not hallucinate" absurd?

Can you tell an LLM "don't hallucinate" and expect it to work? my gut reaction was "oh this is so silly" but upon some reflection, it really isn't. There is actually no reason why it shouldn't work, especially if it was preference-fine-tuned on instructions with "don't hallucinate" in them, and if it a recent commercial model, it likely was.

What does an LLM need in order to follow an instruction? It needs two things:

  1. an ability to perform then task. Something in its parameters/mechanism should be indicative of the task objective, in a way that can be influenced. (In our case, it should "know" when it hallucinates, and/or should be able to change or adapt its behavior to reduce the chance of hallucinations.)
  2. an ability to ground the instruction: the model should be able to associate the requested behavior with its parameters/mechanisms. (In our case, the model should associate "don't hallucinate" with the behavior related to 1).
@schappim
schappim / just_f-ing_ping.md
Last active February 17, 2024 06:15
Just F-ing Ping - Because sometimes you just want to f-ing ping!

Just F-ing Ping

Because sometimes you just want to f-ing ping!

Modern browsers, believing they are being clever, hide the protocol in the URL bar.

image

However, even if you only select the hostname, when you paste that URL into your terminal, you will encounter the following:

image

@pthom
pthom / verbose_function_decorator.py
Last active December 15, 2022 14:19
Python decorator to log function call details (can include: input parameters, output parameters, return value)
import logging
import inspect
def verbose_function(dump_args: bool = True, dump_return: bool = False, dump_args_at_exit: bool = False):
"""
Decorator to print function call details.
This can include:
* input parameters names and effective values
* output parameters (if they were modified by the function)
/**
* This sketch connects an AirGradient DIY sensor to a WiFi network, and sends
* these metrics via MQTT. Adapted from original by Jeff Geerling.
*/
#include <AirGradient.h>
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <PubSubClient.h>
@jasondavis
jasondavis / batch.md
Created October 30, 2021 13:17 — forked from Skhmt/batch.md
Reference for writing .bat/.cmd files in windows
@wlib
wlib / LICENSE
Last active April 30, 2024 17:07
Run a shell script with bash, line-by-line, prompted on each command. Useful for running unknown scripts or debugging. Not a secure substitute for understanding a script beforehand.
MIT License
Copyright (c) 2021 Daniel Ethridge
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@bpsib
bpsib / BBC-Radio-HLS.m3u
Last active November 14, 2024 10:33 — forked from stengland/BBC-Radio.m3u
BBC Radio Streams
#EXTM3U
#EXTINF:-1,BBC - Radio 1
http://as-hls-ww-live.akamaized.net/pool_904/live/ww/bbc_radio_one/bbc_radio_one.isml/bbc_radio_one-audio%3d96000.norewind.m3u8
#EXTINF:-1,BBC - Radio 1Xtra
http://as-hls-ww-live.akamaized.net/pool_904/live/ww/bbc_1xtra/bbc_1xtra.isml/bbc_1xtra-audio%3d96000.norewind.m3u8
#EXTINF:-1,BBC - Radio 1Dance
http://as-hls-ww-live.akamaized.net/pool_904/live/ww/bbc_radio_one_dance/bbc_radio_one_dance.isml/bbc_radio_one_dance-audio%3d96000.norewind.m3u8
#EXTINF:-1,BBC - Radio 1 Anthems (UK Only)
http://as-hls-uk-live.akamaized.net/pool_904/live/uk/bbc_radio_one_anthems/bbc_radio_one_anthems.isml/bbc_radio_one_anthems-audio%3d96000.norewind.m3u8
#EXTINF:-1,BBC - Radio 2
@folkengine
folkengine / install.sh
Created February 6, 2021 15:29 — forked from dannymota/install.sh
Install Chrome, Pip, Venv, ChromeDriver and Selenium on Ubuntu 20.04
#!/usr/bin/env bash
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
# https://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver
# https://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception
# https://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal
# https://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
# Versions
CHROME_DRIVER_VERSION=`curl -sS https://chromedriver.storage.googleapis.com/LATEST_RELEASE`
@FreddieOliveira
FreddieOliveira / docker.md
Last active November 15, 2024 06:39
This tutorial shows how to run docker natively on Android, without VMs and chroot.

Docker on Android 🐋📱

Edit 🎉

All packages, except for Tini have been added to termux-root. To install them, simply pkg install root-repo && pkg install docker. This will install the whole docker suite, left only Tini to be compiled manually.


Summary

Install [Meson and ninja](https://mesonbuild.com/Getting-meson.html).
Build cairo
Disable some options to avoid compile/link errors
```
git clone --depth 1 https://gitlab.freedesktop.org/cairo/cairo.git
meson --prefix=c:\path\to\install --buildtype release -D tests=disabled -D gl-backend=disabled cairo_builddir cairo
meson compile -C cairo_builddir
meson install -C cairo_builddir
```