Skip to content

Instantly share code, notes, and snippets.

@rain-1
rain-1 / llama-home.md
Last active February 22, 2024 05:52
How to run Llama 13B with a 6GB graphics card

This worked on 14/May/23. The instructions will probably require updating in the future.

llama is a text prediction model similar to GPT-2, and the version of GPT-3 that has not been fine tuned yet. It is also possible to run fine tuned versions (like alpaca or vicuna with this. I think. Those versions are more focused on answering questions)

Note: I have been told that this does not support multiple GPUs. It can only use a single GPU.

It is possible to run LLama 13B with a 6GB graphics card now! (e.g. a RTX 2060). Thanks to the amazing work involved in llama.cpp. The latest change is CUDA/cuBLAS which allows you pick an arbitrary number of the transformer layers to be run on the GPU. This is perfect for low VRAM.

  • Clone llama.cpp from git, I am on commit 08737ef720f0510c7ec2aa84d7f70c691073c35d.
@Panakotta00
Panakotta00 / Unreal Engine - Diff-Merge-Tool Setup.adoc
Last active November 10, 2023 05:52
Use the Unreal Editor as Git Diff/Merge Tool

Unreal Engine Asset Diff/Merge-Tool with Git!

Since unreal engines assets are binary encoded classical text based git diff/merge tools will give up on merge conflicts of unreal assets. But fear not! You can setup your git environment to actually be able to diff/merge these .uasset files by using already built-in functionallity of the unreal editor!

Creating the PowerShell-Script

First of all do we have to create a small PowerShell-Script that copies the diff files into temporary files and to convert relative paths to absolute ones.

Building a universal Windows 7/Windows 10 .NET EXE

The problem with building a .NET (classic) executable that runs on both clean Windows 7 install and on Windows 10 is that Windows 7 only ships with .NET 3.5 inbox and Windows 10 ships with .NET 4.X. A .NET 3.5 executable will not run on a (clean install) Windows 10 directly. It can be coerced to do so in multiple ways, but none of them are "worry-free single file" solutions (config file, registry settings, environment variables, etc.).

One of the solutions is to set COMPLUS_OnlyUseLatestCLR environment variable to 1 before the process starts. This will allow .NET 4.X to take over execution of the program. This still doesn't qualify as "worry-free" because we need a batch file or something else to set the envionment for us before the process start (it's too late once Main is executing).

One weird trick to run the same executable on both Windows 7 and Windows 10

When I said we need to set COMPLUS_OnlyUseLatestCLR environment variable to 1 bef

@tavin
tavin / gist:28d1b862eb36594b35306a9d33d48f9c
Created April 19, 2020 15:27
load jenkins pipeline library from local filesystem
library identifier: 'mine@HEAD', retriever: legacySCM([
'$class': 'GitSCM',
'userRemoteConfigs': [[url: 'file:/tmp/my-pipeline-library']],
])
@lantrix
lantrix / experimental.md
Created April 15, 2020 05:16
Docker Buildkit Experimental

Dockerfile frontend experimental syntaxes

Note for Docker users

If you are using Docker v18.06 or later, BuildKit mode can be enabled by setting export DOCKER_BUILDKIT=1 on the client side. Docker v18.06 also requires the daemon to be running in experimental mode.

You need to use docker build CLI instead of buildctl CLI mentioned in this document. See the docker build document for the usage.

export abstract class Result<T> {
abstract isOk(): boolean;
abstract isErr(): boolean;
abstract ok(): T | undefined;
abstract err(): Error | undefined;
static Ok<T>(val: T): Result<T> {
return new OkValue(val);
}
@Jongbhin
Jongbhin / check_cuda_cudnn.md
Last active February 10, 2024 23:24
[Cuda cudnn version check] #cuda #cudnn #nvidia

To check nvidia driver

modinfo nvidia

To check cuda version

cat /usr/local/cuda/version.txt
@coltenkrauter
coltenkrauter / fix-wsl2-dns-resolution
Last active April 17, 2024 07:01
Fix DNS resolution in WSL2
More recent resolution:
1. cd ~/../../etc (go to etc folder in WSL).
2. echo "[network]" | sudo tee wsl.conf (Create wsl.conf file and add the first line).
3. echo "generateResolvConf = false" | sudo tee -a wsl.conf (Append wsl.conf the next line).
4. wsl --terminate Debian (Terminate WSL in Windows cmd, in case is Ubuntu not Debian).
5. cd ~/../../etc (go to etc folder in WSL).
6. sudo rm -Rf resolv.conf (Delete the resolv.conf file).
7. In windows cmd, ps or terminal with the vpn connected do: Get-NetIPInterface or ipconfig /all for get the dns primary and
secondary.
@KarlRamstedt
KarlRamstedt / Warframe Macros.ahk
Last active April 3, 2024 14:26
Spam macros for Slide-Attack, Ability, Primary-fire and Melee in Warframe. Including non-spam Contagion macro.
#NoEnv ; For performance and compatibility with future AutoHotkey releases
SendMode Input ; For speed and reliability
SetBatchLines -1 ; No script sleep, for more consistent timing behavior. Default behavior is 10ms execution then 10ms sleep
ListLines Off ; Increase performance by a few percent by not logging the lines of code that are executed
; Modifiers: [+ = Shift] [^ = Ctrl] [# = Win] [! = Alt] [* = Ignores unspecified modifiers] [~ = Doesn't block normal function] [$ = Forces hook, preventing hotkey self-trigger] More info here: https://www.autohotkey.com/docs/KeyList.htm
; Time values are in ms(MilliSeconds), 1/1000 of a second. 1000/delay = activationsPerSecond. I.e: 50ms delay -> 1000/50 = 20 per sec
; Time values are typically rounded up to a multiple of 10ms by the Windows time-keeping system. So there's no point to Timer/Sleep values that aren't multiples of 10. Higher precision may be achieved via Loop+DllCall, but is rarely relevant and certainly doesn't matter for this script
global slideDela
@klequis
klequis / react-auth0-spa.js
Last active March 29, 2024 01:18
Modification to Auth0Provider in react-auth0-spa.js
import React, { useState, useEffect, useContext } from 'react'
import createAuth0Client from '@auth0/auth0-spa-js'
const DEFAULT_REDIRECT_CALLBACK = () =>
window.history.replaceState({}, document.title, window.location.pathname)
export const Auth0Context = React.createContext()
export const useAuth0 = () => useContext(Auth0Context)
let _initOptions