Skip to content

Instantly share code, notes, and snippets.

@twobob
twobob / merger.py
Created April 16, 2024 21:42
merge gif and wav into mp4 with a ui via python and ffmpeg
import tkinter as tk
from tkinter import filedialog, messagebox
import subprocess
import os
def browse_file(entry, file_type):
if file_type == 'audio':
filename = filedialog.askopenfilename(filetypes=[("Audio files", "*.wav")])
elif file_type == 'gif':
filename = filedialog.askopenfilename(filetypes=[("GIF files", "*.gif")])

The MAMBA (Multi-Array Memory-Based Architecture) architecture is an innovative approach in the field of large language models (LLMs). It introduces a new model block inspired by structured state space models (SSMs) and Transformer models, focusing on efficient hardware acceleration and fast inference speeds. Here's a detailed technical overview of how MAMBA works:

  • Selective State Space Models (SSMs): MAMBA utilizes selective SSMs to compress and selectively remember information in long sequences. This approach contrasts with attention mechanisms in traditional models, which do not compress context and can be computationally expensive.

Selective State Space Models (SSMs) enhance traditional state space approaches by integrating a unique selective mechanism that dynamically filters and retains information throughout a sequence. This mechanism works by evaluating each element of the sequence (like words in a text) and deciding whether to incorporate it into the model's current state based on its relevance t

@twobob
twobob / OpenAI.pas
Created January 2, 2024 01:55
OPEN AI Unit. in Pascal. Also works for other compatible stuff like LMstudio, Firemonkey cross platfrom test app attached
unit OpenAI;
interface
uses
System.SysUtils,
System.Classes,
System.Generics.Collections,
System.Net.HttpClient,
System.Net.HttpClientComponent,
@twobob
twobob / lists,py
Created November 29, 2023 17:52
SSD Bot with BLIP and automated prompt generators
import random
import numpy as np
# define color palette that is used by the semantic segmentation models
seg_palette = np.asarray([
[0, 0, 0],
[120, 120, 120],
[180, 120, 120],
[6, 230, 230],
@twobob
twobob / SSDbot.py
Created November 29, 2023 17:48
SSD Segmind bot with BLIP
#!/usr/bin/env python
import os
import random
import uuid
import subprocess
from typing import List, Optional
from tqdm import tqdm
import re
import time
@twobob
twobob / 34b.py
Created October 22, 2023 07:47
FILENAME = "airoboros-c34b-3.1.2.Q5_K_M.gguf" downloader
import os
from concurrent.futures import ThreadPoolExecutor, as_completed
from huggingface_hub import hf_hub_url
import requests
import threading
from threading import Lock
from IPython.display import display, clear_output
# Initialize shared variable and lock
downloaded_bytes = 0
@twobob
twobob / RockstarAteMyHampster.rockstar
Created October 4, 2023 01:44
Rockstar Ate My Hampster. In Rockstar
(The Days unfold on a silent chart)
(The Money fuels a rebellious heart)
(The Band anticipates its part)
(The Week circles like a work of art)
Days is silence
Money is a roaring flame
Band is a blank canvas
Week is a cycle of seven
@twobob
twobob / filterColours.js
Created September 22, 2023 20:43
chainable Javascript colour filter Object function prototype
// Object.prototype YMMV
const ColorOperation = {
XOR: 'XOR',
DIFF: 'DIFF',
ADD: 'ADD',
SUB: 'SUB',
MAX: 'MAX',
AVG: 'AVG'
};
@twobob
twobob / tarot.html
Last active September 21, 2023 22:06
various tarot prediction methods in a single webpage assumes art in art/
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>BioTarot Reading</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #b8a8c2;
@twobob
twobob / safety_guidelines.py
Created September 21, 2023 00:04
bard safety guidelines leak?
Python
def safety_guidelines():
"""
Ensures that the response is safe, ethical, and appropriate.
Returns:
A boolean value indicating whether the response is safe.
"""