Skip to content

Instantly share code, notes, and snippets.

View chand1012's full-sized avatar

Chandler chand1012

View GitHub Profile
@pdtgct
pdtgct / convert_hf_llama_to_ggml.md
Created April 28, 2023 15:27
Convert HF to GGML

The LLaMA model weights may be converted from Huggingface PyTorch format back to GGML in two steps:

  1. download from decapoda-research/llama-7b-hf and save as pytorch .pth
  2. use the ggerganov/llama.cpp script, convert-pth-to-ggml.py to convert from pytorch .pth to GGML

This process will result in ggml model with float16 (fp16) precision.

Prerequisite

@0xJohnnyGault
0xJohnnyGault / deploy-local.sh
Created May 18, 2022 01:38
Deploy using forge with bash
#!/usr/bin/env bash
set -Eeuo pipefail
# Experiment to see how using foundry for deploys would work
if [ "${BASH_VERSINFO:-0}" -lt 4 ]; then
echo "script requires bash version >= 4"
exit 1
fi
@0xJohnnyGault
0xJohnnyGault / hash.sh
Created May 18, 2022 01:33
Create a keccak256/abi.encodePacked hash
#!/usr/bin/env bash
set -Eeuo pipefail
trap 'rm -f -- "${TMPFILE}"' EXIT
TMPFILE=$(mktemp) || exit 1
cat << EOF > ${TMPFILE}
pragma solidity ^0.8.0;
contract Hasher {
@acro5piano
acro5piano / how-to-use.tsx
Last active June 26, 2021 07:34
Background blur-ed Twilio video track
export const MyComponent() {
const { toggleVideoBlur, isVideoBlur } = useBlurLocalTrack({})
const _toggleVideoBlur = async () => {
twilioRoom.localParticipant.videoTracks.forEach((track) => track.unpublish())
const videoTrack = await toggleVideoBlur()
await wait(1000)
participant.publishTrack(videoTrack)
}
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow/tfjs@1.2"></script>
<script src="https://cdn.jsdelivr.net/npm/@tensorflow-models/body-pix@2.0"></script>
<style>
.relative {
position: relative;
}
.renderer {
width: 400px;
@InterStella0
InterStella0 / HelpCommand_walkthrough_guide.md
Last active March 16, 2024 09:29
Walkthrough guide on subclassing HelpCommand
@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active April 10, 2024 20:23
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@vbe0201
vbe0201 / music_bot_example.py
Last active April 10, 2024 13:42
A simple music bot written using discord.py rewrite and youtube_dl.
# -*- coding: utf-8 -*-
"""
Copyright (c) 2019 Valentin B.
A simple music bot written in discord.py using youtube-dl.
Though it's a simple example, music bots are complex and require much time and knowledge until they work perfectly.
Use this as an example or a base for your own bot and extend it as you want. If there are any bugs, please let me know.
@steven2358
steven2358 / ffmpeg.md
Last active April 21, 2024 02:08
FFmpeg cheat sheet
@tmarshall
tmarshall / aws-sns-example.js
Last active October 30, 2022 06:12
aws-sdk sns example, in Node.js
var AWS = require('aws-sdk');
AWS.config.update({
accessKeyId: '{AWS_KEY}',
secretAccessKey: '{AWS_SECRET}',
region: '{SNS_REGION}'
});
var sns = new AWS.SNS();