Skip to content

Instantly share code, notes, and snippets.

@winglian
winglian / README.md
Last active March 29, 2023 22:00
fine-tuning using vast.ai

procure a machine

  • Use the following docker image: pytorch/pytorch:1.13.1-cuda11.6-cudnn8-runtime
  • Launch an instance of your choice
  • SSH into your instance

install dependencies

apt-get update
apt-get install -y build-essential ninja-build
pip3 install -q accelerate bitsandbytes datasets sentencepiece safetensors pybind11
@winglian
winglian / docker-npm.js
Created October 27, 2017 22:29 — forked from jokeyrhyme/docker-npm.js
execute `npm` within a Docker container, within the host's working directory
'use strict'
// ideal for use with AWS Lambda and native Node.js modules
// requires Docker: https://docs.docker.com/engine/installation/
/*
Usage:
node docker-npm.js install
node docker-npm.js rebuild
@winglian
winglian / Middleware.js
Created December 23, 2016 15:53 — forked from unbug/Middleware.js
Powerful Javascript Middleware Pattern Implementation, apply middleweare to any object.
'use strict';
/* eslint-disable consistent-this */
let applyMiddlewareHash = [];
/**
* Composes single-argument functions from right to left. The rightmost
* function can take multiple arguments as it provides the signature for
* the resulting composite function.
*
@winglian
winglian / gen.swift
Created November 11, 2016 16:45 — forked from blainerothrock/gen.swift
A Very Simple Genetic Algorithm Written in Swift 3
#!/usr/bin/env xcrun swift
/*
gen.swift is a direct port of cfdrake's helloevolve.py from Python 2.7 to Swift 3
-------------------- https://gist.github.com/cfdrake/973505 ---------------------
gen.swift implements a genetic algorithm that starts with a base
population of randomly generated strings, iterates over a certain number of
generations while implementing 'natural selection', and prints out the most fit
string.
@winglian
winglian / bd_upgrade_es_on_semaphoreci.sh
Last active March 25, 2016 20:36 — forked from vlado/bd_upgrade_es_on_semaphoreci.sh
[BD] Upgrade Elasticsearch on SemaphoreCI
rbenv global 2.2.2
sudo service elasticsearch stop
if ! [ -e .semaphore-cache/elasticsearch-2.2.1.deb ]; then (cd .semaphore-cache; curl -OL https://download.elasticsearch.org/elasticsearch/release/org/elasticsearch/distribution/deb/elasticsearch/2.2.1/elasticsearch-2.2.1.deb); fi
echo Y | sudo dpkg -i .semaphore-cache/elasticsearch-2.2.1.deb
sudo service elasticsearch start
sleep 5 && curl -XGET 'localhost:9200'
@winglian
winglian / fileName
Created October 5, 2014 14:05
created with LaravelDBDesigner
[{"name":"Bears","color":"Blue","position":{"x":177,"y":85},"modelclass":"Bear","increment":false,"timestamp":false,"softdelete":false,"column":[{"colid":"c217","name":"id","type":"increments","length":"0","order":0,"defaultvalue":"","enumvalue":""},{"colid":"c218","name":"name","type":"string","length":"200","order":1,"defaultvalue":"","enumvalue":""},{"colid":"c219","name":"danger_level","type":"string","length":"200","order":2,"defaultvalue":"","enumvalue":""}],"relation":[{"extramethods":"","foreignkeys":"","name":"fish","relatedmodel":"Fish","relationtype":"hasOne","usenamespace":""},{"extramethods":"","foreignkeys":"","name":"trees","relatedmodel":"Trees","relationtype":"hasMany","usenamespace":""},{"extramethods":"","foreignkeys":"bear_id, picnic_id","name":"picnics","relatedmodel":"Picnics","relationtype":"belongsToMany","usenamespace":""}],"seeding":[]},{"name":"Fish","color":"Yellow","position":{"x":1063,"y":14},"modelclass":"Fish","increment":false,"timestamp":false,"softdelete":false,"column":[{"c
@winglian
winglian / RouteCommand.php
Created February 15, 2013 05:08
RouteCommand for L4 that mimics the L3 version
<?php
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;
class RouteCommand extends Command {
/**
* The console command name.