Skip to content

Instantly share code, notes, and snippets.

View FarisHijazi's full-sized avatar
:shipit:
ඞඞඞ

Faris Hijazi FarisHijazi

:shipit:
ඞඞඞ
View GitHub Profile
@NaxAlpha
NaxAlpha / pythia_1b4_8k.py
Last active April 4, 2024 17:19
Fine-tune Pythia 1.4b model for 8k context window, this script requires at least 40 GB of memory, 15-20 hours of fine-tune is sufficient.
import copy
import torch
import torch.nn.functional as F
import torch.backends.cuda as cuda
from torch.utils.data import DataLoader, IterableDataset
import wandb
from tqdm import tqdm
import bitsandbytes as bnb
@Christopher-Hayes
Christopher-Hayes / convertToCheckpoint.md
Last active June 2, 2024 14:56
Convert DreamBooth .bin files to a .ckpt file

Converting DreamBooth .bin files to a .ckpt model file.

These instructions are based on DreamBooth usage with the https://github.com/ShivamShrirao/diffusers repo.

1. Add the script files

Below are 2 files. "convertToCkpt.py" and "toCkpt.sh". Create those files inside the examples/dreambooth folder with the code provided.

1a. Python convert script (required)

"""
VoiceFixer
$ python voicefixer_cli.py -i ~/Downloads/download.mp3
# for running on multiple files
$ find path/to/folder -name "*.wav" -not -name "*denoised*" |xargs -P 20 -I{} sh -c 'python voicefixer_cli.py -i {}'
"""
"""
@FarisHijazi
FarisHijazi / vidsplit.sh
Last active September 26, 2021 10:01
segment videos into video or GIF segments using ffmpeg
#!/bin/bash
# https://gist.github.com/FarisHijazi/4ba8d9768eddc6f218ecd21824c24909
#TODO: fix directory naming, name it something related to the file
# argparsing from: https://stackoverflow.com/a/39376824/7771202
# usage function
function usage()
{
@ma7dev
ma7dev / vscode-jupyter-remote.md
Last active February 8, 2023 12:57
How to use a remote Jupyter notebook in VS code

To run access a remote jupyter notebook, you will need to do the following:

  1. Setting ssh config file (~/.ssh/config):
Host FLIP # access point server
    HostName access.engr.oregonstate.edu
    User ONIDusername
Host DGX # target server
    HostName submit-b.hpc.engr.oregonstate.edu
    User ONIDusername
@ma7dev
ma7dev / README.md
Last active March 25, 2023 21:43
Streamlit + Flask example

A simple example for Streamlit and Flask project

  • server.py contains the API code for the Flask server (back-end)
  • main.py contains the streamlit code (front-end)

Requirements

pip install plotly streamlit pandas requests flask
@Mahedi-61
Mahedi-61 / cuda_11.8_installation_on_Ubuntu_22.04
Last active October 28, 2024 20:42
Instructions for CUDA v11.8 and cuDNN 8.9.7 installation on Ubuntu 22.04 for PyTorch 2.1.2
#!/bin/bash
### steps ####
# Verify the system has a cuda-capable gpu
# Download and install the nvidia cuda toolkit and cudnn
# Setup environmental variables
# Verify the installation
###
### to verify your gpu is cuda enable check
@bijij
bijij / viewimage.user.js
Last active November 11, 2024 07:06
Userscript version of the View Image chrome extension
// ==UserScript==
// @name View Image
// @namespace https://github.com/bijij/ViewImage
// @version 4.1.1
// @description This userscript re-implements the "View Image" and "Search by image" buttons into google images.
// @author Joshua B
// @run-at document-end
// @include http*://*.google.tld/search*tbm=isch*
// @include http*://*.google.tld/imgres*
// @updateURL https://gist.githubusercontent.com/bijij/58cc8cfc859331e4cf80210528a7b255/raw/viewimage.user.js
@andres-erbsen
andres-erbsen / itershuffle.py
Created October 23, 2011 19:22
Shuffle for python iterators. This works by holding `bufsize` items back and yielding them sometime later. This is NOT 100% random, proved or anything.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import random
def itershuffle(iterable,bufsize=1000):
"""Shuffle an iterator. This works by holding `bufsize` items back
and yielding them sometime later. This is NOT 100% random, proved or anything."""
iterable = iter(iterable)
buf = []