Skip to content

Instantly share code, notes, and snippets.

View AbhimanyuAryan's full-sized avatar
:atom:
transformers

Abhimanyu Aryan AbhimanyuAryan

:atom:
transformers
View GitHub Profile
@kamilogorek
kamilogorek / _screenshot.md
Last active April 9, 2024 21:18
Clutter-free VS Code Setup
image
@dteoh
dteoh / article_starcoder_macbook.md
Last active March 18, 2024 10:20
How to run StarCoderBase 1B SFT on a MacBook Pro with Apple Silicon

How to run StarCoderBase 1B SFT on a MacBook Pro with Apple Silicon

These are notes on how I managed to get StarCoderBase-1B-SFT model compiled into a quantized version such that it can run locally on my MBP M1 Pro and be queryable through an OpenAI API-compatible server. [StarCoderBase][1] is a model trained/tuned for programming tasks. The [1B parameters SFT model][2] I am using in this article is a version of the model that has had supervised fine tuning applied to it. I am just going to call this "StarCoder" in the rest of this article for the sake of simplicity. Number of parameters that a model has is going to impact resource usage, so a smaller version of the model makes it more

@gdalle
gdalle / stars.jl
Created September 1, 2022 13:53
Counting stars for Julia packages
using CSV
using GitHub
using Pkg
using ProgressMeter
using TOML
myauth = GitHub.authenticate(ENV["GITHUB_AUTH"])
general = first(reg for reg in Pkg.Registry.reachable_registries() if reg.name == "General")
package_url = Dict{String,String}()

Deploying Julia on heroku

Let's assume that you can run your web server on your own computer, and that you can open it in your own browser (through localhost or 127.0.0.1). This guide will go through the steps of putting that app online!

This guide will be based on a hello world sample project that uses Genie.jl, but the steps from this guide apply to any Julia web framework.

heroku has tons of features, but for a simple app, we only need the basics. In particular, we do not need the heroku command line, we can do everything through the online GUI.

Basics

heroku uses git for deployment: to package your app, you create a git repository, and to put a new version of your app online, you push to the git repository. If you already know git, then you now know how to manage a web server! It's like GitHub pages, but more powerful (and more complicated). Read heroku's introduction for a basi

@shenhuang
shenhuang / decrypt.jl
Last active September 5, 2022 15:53
Julia code for Caesar shift and columnar transposition cracking.
cipherText = "KUHPVIBQKVOSHWHXBPOFUXHRPVLLDDWVOSKWPREDDVVIDWQRBHBGLLBBPKQUNRVOHQEIRLWOKKRDD"
println("Begin to decrypt cipher text: ", cipherText)
#https://en.wikipedia.org/wiki/Letter_frequency
frequencies = Dict( "A" => 8.167,
"B" => 1.492,
"C" => 2.782,
"D" => 4.253,
"E" => 12.702,
@CoolOppo
CoolOppo / Cargo.toml
Last active January 2, 2024 10:27
How to compile to a DLL in rust while using it as a normal rust library
[package]
name = "test"
version = "0.1.0"
authors = ["YOU <YOU@users.noreply.github.com>"]
edition = "2018"
[lib]
crate-type = ["cdylib"]
@zcaceres
zcaceres / node-python-fastai.md
Last active May 16, 2023 07:20
Starter code to use NodeJS with a Python layer for the model.

Deploying a Deep Learning Image Classification Model with NodeJS, Python, and Fastai

TL|DR: Use this to easily deploy a FastAI Python model using NodeJS.

You've processed your data and trained your model and now it's time to move it to the cloud.

If you've used a Python-based framework like fastai to build your model, there are several excellent solutions for deployment like Django or Starlette. But many web devs prefer to work in NodeJS, especially if your model is only part of a broader application.

My friend Navjot pointed out that NodeJS and Python could run together if we could send remote procedure calls from NodeJS to Python.

@DataTurks
DataTurks / dataturks_to_PascalVOC.py
Last active April 26, 2020 08:54
Covert Dataturks Image bounding box JSON to Pascal VOC format.
import argparse
import sys
import os
import json
import logging
import requests
from PIL import Image
################### INSTALLATION NOTE #######################
##############################################################
@rotemtam
rotemtam / pascal_to_csv.py
Created April 14, 2018 09:49
pascal voc xml to csv table
import os
import glob
import pandas as pd
import xml.etree.ElementTree as ET
def xml_to_csv(path):
xml_list = []
for xml_file in glob.glob(path + '/*.xml'):
tree = ET.parse(xml_file)
def generate(label):
(
bbox_xmin,
bbox_ymin,
bbox_xmax,
bbox_ymax,
img_width,
img_height
) = (
label.get('xmin'),