Skip to content

Instantly share code, notes, and snippets.

View segestic's full-sized avatar
🎯
Focusing

Olusegun O. segestic

🎯
Focusing
View GitHub Profile
@segestic
segestic / merge_peft.py
Created May 29, 2025 13:58 — forked from mlabonne/merge_peft.py
Merge base model and peft adapter and push it to HF hub
# Example usage:
# python merge_peft.py --base_model=meta-llama/Llama-2-7b-hf --peft_model=./qlora-out --hub_id=alpaca-qlora
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
import argparse
def get_args():
@segestic
segestic / install_docker_in_colab.sh
Created May 5, 2025 12:33 — forked from mwufi/install_docker_in_colab.sh
Install Docker in Google Colab!
# First let's update all the packages to the latest ones with the following command
sudo apt update -qq
# Now we want to install some prerequisite packages which will let us use HTTPS over apt
sudo apt install apt-transport-https ca-certificates curl software-properties-common -qq
# After that we will add the GPG key for the official Docker repository to the system
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# We will add the Docker repository to our APT sources
@segestic
segestic / writing-a-state-of-the-art-section.md
Created January 7, 2025 04:11 — forked from ikbelkirasan/writing-a-state-of-the-art-section.md
Writing the "Related Work" Section of a Paper/thesis

Writing the "Related Work" Section of a Paper/thesis

By: Chamin Morikawa (https://www.linkedin.com/pulse/writing-related-work-section-paperthesis-chamin-morikawa/)

For most students, writing about what they did on their own is not hard. But writing about others' work - which is what you have to do in the "State of the Art" or "Related Work" section - is quite hard for them. Here are a few guidelines to make this task a bit easier.

The Basics

Let's lay down our assumptions before continuing. I assume that you want to write a "Related Work" section for a research paper or a thesis that describes your approach to solve some problem. Let's also assume that there are other publications that attempt to solve the same problem, but the solutions in them are not perfect. Finally, let's assume that your approach has some difference when compared to those by others, and some improvement (faster, more accurate, easier to afford, etc.).

@segestic
segestic / reshard.py
Created August 17, 2023 17:47 — forked from benob/reshard.py
Script to decompose/recompose LLAMA LLM models with different number of shards.
# script to decompose/recompose llama model in different number of shards
# note that it loads the full model * 2 in cpu memory
import os
import json
import sys
import torch
import glob
if len(sys.argv) != 4:
@segestic
segestic / Debootstrap Debian Arm64 OS for Raspberry Pi 3 & 4.md
Last active June 1, 2023 07:33 — forked from G-UK/Debootstrap Debian Arm64 OS for Raspberry Pi 3 & 4.md
Build a 64bit Debian OS for the Raspberry Pi using Debootstrap

#another tutorial from below - https://2names1scott.com/docs/debootstrap.html

Introduction

The objective of these instructions is to create a complete Arm64 OS (Userland and Kernel) using Debian Debootstrap and RPI-Update for use on the Raspberry Pi 3 and 4.

Prerequisites:

  • An existing Debian/Raspbian system (any architecture will do)
  • An empty SD card formatted as per a standard Raspbian installation mounted to /mnt/sd on the build system
    • 1st Partition 0-256MB = FAT32 (Mount to /mnt/sd/boot)
  • 2nd Partition 256MB+ = EXT4 (Mount to /mnt/sd)
@segestic
segestic / gpt4all-langchain-demo.ipynb
Last active April 18, 2023 08:14
GPT4all-langchain-demo.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@segestic
segestic / GPT4all-langchain-demo.ipynb
Created April 6, 2023 08:55 — forked from psychemedia/GPT4all-langchain-demo.ipynb
Example of running GPT4all local LLM via langchain in a Jupyter notebook (Python)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@segestic
segestic / free-database-hosting.md
Created December 20, 2022 14:16 — forked from bmaupin/free-database-hosting.md
Free database hosting
@segestic
segestic / index.md
Created June 29, 2022 00:30 — forked from ericandrewlewis/index.md
C++ Pointer Tutorial

C++ Pointer Tutorial

Because pointers can be ugh

"Regular" variables (not pointers)

To understand a pointer, let's review "regular" variables first. If you're familiar with a programming language without pointers like JavaScript, this is what you think when you hear "variable".

When declaring a variable by identifier (or name), the variable is synonymous with its value.

@segestic
segestic / classification-pneu-dic-kggle-ipynb-1.ipynb
Created November 11, 2021 19:09
classification-pneu-dic-kggle-ipynb (1).ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.