Skip to content

Instantly share code, notes, and snippets.

View din0s's full-sized avatar

dinos din0s

View GitHub Profile
@din0s
din0s / tensor_mapping.patch
Created October 3, 2024 10:42
Adds support for Mistral Lora weights conversion to GGUF (llama.cpp build b3867)
diff --git a/gguf-py/gguf/tensor_mapping.py b/gguf-py/gguf/tensor_mapping.py
index f4a787c56..5b8390f60 100644
--- a/gguf-py/gguf/tensor_mapping.py
+++ b/gguf-py/gguf/tensor_mapping.py
@@ -146,6 +146,7 @@ class TensorNameMap:
# Attention query
MODEL_TENSOR.ATTN_Q: (
"model.layers.{bid}.self_attn.q_proj", # llama-hf nemotron olmoe
+ "layers.{bid}.self_attn.q_proj", # mistral lora
"layers.{bid}.attention.wq", # llama-pth
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
@din0s
din0s / fibonacci.asm
Created June 20, 2019 01:27
Fibonacci Sequence in MIPS (Generated 20/06/2019)
# Program in C: (calculates the fibonacci sequence for N=10)
#
# int main() {
# int first, second, i, tmp;
# first = 0;
# second = 1;
# i = 0;
# tmp = 0;
# while (i < 10) {
# i = i + 1;
@din0s
din0s / plot.py
Created November 4, 2018 00:26
MatPlotLib function/implementation
from numpy import *
import matplotlib.pyplot as plt
def draw_plot(*func, x_label, y_label, x_range, unit='x', lim_axes=False, point=None, point_text="", flip_point=False):
# Draw a subplot
fig, ax = plt.subplots()
plot_range = arange(x_range[0], x_range[1], 0.01)
# Draw the plots
clear
// ================== Rates ===================
echo
echo "Initializing RATES"
echo
rate "128000"
cl_cmdrate "128"
cl_updaterate "128"
@din0s
din0s / build.gradle
Last active January 13, 2017 19:53
Kotlin
buildscript {
ext.kotlin_version = '1.0.6'
repositories {
jcenter()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
@din0s
din0s / build.gradle
Last active January 13, 2017 19:53
Java
plugins {
id 'com.github.johnrengelman.shadow' version '1.2.4'
id 'application'
id 'java'
}
group 'me.dinosparkour'
version '0.0.1'
mainClassName = "${group}.App"
@din0s
din0s / deeBot.md
Last active February 24, 2018 12:43

!!8ball [question]:

Returns an answer to your question by the almighty 8-ball.

!!addrole [user] [role]:

Adds a role to the specified user.

!!announcement (duration / reset) (time unit) (text):

public static String getCreationTime(long id) {
SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss z");
sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
return sdf.format(id >> 22 + 1420070400000L);
}