Skip to content

Instantly share code, notes, and snippets.

@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.
"""
@twobob
twobob / snake.phi.py
Created September 12, 2023 22:56
prompt = "A simple snake game written in python using pygame" phi engine
#Question: Write a simple feature-complete snake game written in python using pygame.
#"""
# 1. Overview and imports
# Import pygame for the game
import pygame
pygame.init()
@twobob
twobob / gotchas_for_me.ps1
Created September 7, 2023 17:22
pip3 install llama-cpp-python
#in my case on windows I had to
New-Item -ItemType SymbolicLink -Path "C:\Python311\bin" -Target "C:\Python311"
#as admin
#I also did not have f2py.exe in my python so I kinda welded it in from a similar one...
#by just dumping the copies in scripts and praying.
#also needed to
Get-ChildItem -Path 'C:\Python311' -Directory | Where-Object { $_.Name -ne 'bin' } | Get-ChildItem -Recurse | Where-Object { $_.PSIsContainer -or $_.Extension -eq '.exe' } | ForEach-Object { icacls $_.FullName /grant "YourUserNameHere:(OI)(CI)F" }