Skip to content

Instantly share code, notes, and snippets.

View CoolOppo's full-sized avatar
🇺🇲

Max Azoury CoolOppo

🇺🇲
View GitHub Profile
@hanxiao
hanxiao / testRegex.js
Last active September 19, 2024 16:04
Regex for chunking by using all semantic cues
// Updated: Aug. 20, 2024
// Run: node testRegex.js whatever.txt
// Live demo: https://jina.ai/tokenizer
// LICENSE: Apache-2.0 (https://www.apache.org/licenses/LICENSE-2.0)
// COPYRIGHT: Jina AI
const fs = require('fs');
const util = require('util');
// Define variables for magic numbers
const MAX_HEADING_LENGTH = 7;
@disler
disler / README_MINIMAL_PROMPT_CHAINABLE.md
Last active September 17, 2024 17:54
Minimal Prompt Chainables - Zero LLM Library Sequential Prompt Chaining & Prompt Fusion

Minimal Prompt Chainables

Sequential prompt chaining in one method with context and output back-referencing.

Files

  • main.py - start here - full example using MinimalChainable from chain.py to build a sequential prompt chain
  • chain.py - contains zero library minimal prompt chain class
  • chain_test.py - tests for chain.py, you can ignore this
  • requirements.py - python requirements

Setup

import time
import os
import logging
import random
from datasets import load_dataset
class QuantAutoGPTQ:
def __init__(self, model_name_or_path, output_dir, dataset,
num_samples=128, trust_remote_code=False, cache_examples=True,
use_fast=True, use_triton=False, bits=[4], group_size=[128], damp=[0.01],
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
import os
import argparse
def get_args():
parser = argparse.ArgumentParser()
parser.add_argument("--base_model_name_or_path", type=str)
➜ babyagi git:(main) python3.9 babyagi.py
*****OBJECTIVE*****
I have been given no context other than I am an agent existing in a universe. Why am I here? I do not know. I must discover my own objective.
Initial task: Begin
*****TASK LIST*****
@YuRaNnNzZZ
YuRaNnNzZZ / TFA Base Documentation.md
Last active January 24, 2023 07:29
TFA Base Documentation (obsolete)
@RubenKelevra
RubenKelevra / fast_firefox.md
Last active September 19, 2024 14:37
Make Firefox fast again
@shobhitic
shobhitic / MyToken.sol
Created March 26, 2022 11:24
Merkletree Allowlist / Whitelist for NFT
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts@4.5.0/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts@4.5.0/access/Ownable.sol";
import "@openzeppelin/contracts@4.5.0/utils/Counters.sol";
import "@openzeppelin/contracts@4.5.0/utils/cryptography/MerkleProof.sol";
contract MyToken is ERC721, Ownable {
using Counters for Counters.Counter;
@peerasan
peerasan / ffmpeg-build.sh
Last active September 10, 2024 13:46
Build FFmpeg
# Watch video: https://youtu.be/qLw6ZWUXy7U
#Require for Compiler
apt-get install -y autoconf automake build-essential cmake git-core libass-dev libfreetype6-dev libgnutls28-dev libsdl2-dev libtool libva-dev libvdpau-dev libvorbis-dev libxcb1-dev libxcb-shm0-dev libxcb-xfixes0-dev meson ninja-build pkg-config texinfo wget yasm zlib1g-dev
#Require for FFmpeg
apt-get install nasm libx264-dev libx265-dev libnuma-dev libvpx-dev libfdk-aac-dev libmp3lame-dev libopus-dev libunistring-dev
mkdir ~/ffmpeg_sources
cd ~/ffmpeg_sources