Skip to content

Instantly share code, notes, and snippets.

@cedrickchee
cedrickchee / meta-llama-guide.md
Created March 12, 2023 11:37
Meta's LLaMA 4-bit chatbot guide for language model hackers and engineer

info 9-3-23 Added 4bit LLaMA install instructions for cards as small as 6GB VRAM! (See "BONUS 4" at the bottom of the guide)

warning 9-3-23 Added Torrent for HFv2 Model Weights, required for ooga's webUI, Kobold, Tavern and 4bit (+4bit model)! Update ASAP!

danger 11-3-23 There's a new torrent version of the 4bit weights called "LLaMA-HFv2-4bit". The old "LLaMA-4bit" torrent may be fine. But if you have any issues with it, it's recommended to update to the new 4bit torrent or use the decapoda-research versions off of HuggingFace or produce your own 4bit weights. Newer Torrent Link or [Newer Magnet Link](magnet:?xt=urn:btih:36945b5958b907b3ab69e963ba0de1abdf48c16c&dn=LLaMA-HFv2-4bit&tr=http%3a%2f%2fbt1.archive.org%3a6969%2fannounce&tr=http%3a%2f%2fbt2.archive.org%3a696

@Vbif
Vbif / file.cpp
Last active April 5, 2021 19:30
Defold - auto register enums
// test compile
typedef double lua_Number;
typedef struct {} lua_State;
void lua_pushnumber (lua_State *L, lua_Number n) {}
void lua_setfield (lua_State *L, int index, const char *k) {}
// test
#include <stdlib.h>
#include <string.h>
typedef struct {
// These fields are internal state and not considered part of the public interface.
Node *parent;
int next_index;
// This field is public and valid to read after a call to next that returns true.
Node *child;
} Iter;
Iter iter_children(Node *node) {
@aglitchman
aglitchman / compile_shader.editor_script
Last active November 30, 2021 15:02
Editor script for Defold IDE. The script adds the menu items "Compile Fragment Shader" and "Compile Vertex Shader" for .fp/.vp files.
-- Download and install Arm Mobile Studio from
-- https://developer.arm.com/tools-and-software/graphics-and-gaming/arm-mobile-studio/components/mali-offline-compiler
local M = {}
local function ends_with(str, ending)
return ending == "" or str:sub(-#ending) == ending
end
function M.get_commands()
@dapetcu21
dapetcu21 / style-guide.md
Created April 27, 2018 14:28
Interrogation Style Guide

Lua style guide

Linting

This project makes use of [Luacheck] for catching common mistakes. Install it and configure it for your text editor.

Editor configuration

We recommend [Atom] for editing Lua code along with the following packages:

  • [linter-luacheck]: [Luacheck] integration
@Jerakin
Jerakin / builder.py
Last active July 9, 2018 18:24
For building and deploying Defold projects directly to your phone
"""
Builder is built by wrapping adb and storing some data locally
I would recommend to add an alias to your ~.bash_profile to use it easier
alias builder="python3.5 ~/Documents/repo/builder/builder.py"
Usage:
builder.py [command] [arguments]
Available Commands:
build build [location of a project]
install install [path to APK]
uninstall uninstall [bundle id]
@mathiaswking
mathiaswking / android_deploy.sh
Last active June 18, 2019 07:24
Deploys an .apk to the USB connected Android device. Starts the app, and grabs the logging events for that PID
#!/usr/bin/env bash
#set -e
PACKAGE=$1
if [ -z "$PACKAGE" ]; then
echo "You must pass a .apk as input!"
exit 1
fi
@britzl
britzl / bundle.sh
Last active December 10, 2020 13:45
Script to build and bundle a Defold project for multiple platforms
#!/bin/bash
title=$(less game.project | grep "^title = " | cut -d "=" -f2 | sed -e 's/^[[:space:]]*//')
title_no_space=$(echo -e "${title}" | tr -d '[[:space:]]')
echo "Project: ${title}"
if [ ! -f bob.jar ]
then
echo "Unable to find bob.jar. Download it from d.defold.com."
exit 1
@JCash
JCash / make_gif_from_video.sh
Created July 17, 2016 10:12
A quick way to convert Defold video (.ivf) into a compressed .gif
#!/usr/bin/env bash
FPS=15
SIZEPX=320
STARTTIME=0
DURATION=0
PALETTE="/tmp/palette.png"
TMPGIF="/tmp/$2"
@t0chas
t0chas / CustomEditorBase.cs
Last active March 5, 2024 16:47
Default Custom Inspector-Editor for Unity3D with ReorderableLists for arrays handling
using UnityEngine;
using UnityEditor;
using UnityEditorInternal;
using System.Collections.Generic;
using UnityEditor.AnimatedValues;
[CustomEditor(typeof(UnityEngine.Object), true, isFallback = true)]
[CanEditMultipleObjects]
public class CustomEditorBase : Editor
{