Setup Environmnet variables for Hadoop.
export HADOOP_VERSION=2.8.5
export HADOOP_HOME=${HOME}/hadoop-$HADOOP_VERSION
export HADOOP_CONF_DIR=$HADOOP_HOME/etc/hadoop
export PATH=${HADOOP_HOME}/bin:$PATH
Download Hadoop files.
# pip install -U bitsandbytes | |
# pip install -U git+https://github.com/huggingface/transformers.git | |
from transformers import AutoModelForCausalLM, AutoTokenizer | |
model_id = "mistralai/Mixtral-8x7B-Instruct-v0.1" | |
path_to_hub = XXX | |
tokenizer = AutoTokenizer.from_pretrained(model_id) | |
model = AutoModelForCausalLM.from_pretrained(model_id, load_in_4bit=True) | |
model.push_to_hub(path_to_hub) |
Setup Environmnet variables for Hadoop.
export HADOOP_VERSION=2.8.5
export HADOOP_HOME=${HOME}/hadoop-$HADOOP_VERSION
export HADOOP_CONF_DIR=$HADOOP_HOME/etc/hadoop
export PATH=${HADOOP_HOME}/bin:$PATH
Download Hadoop files.
""" | |
Classic cart-pole system implemented by Rich Sutton et al. | |
Copied from http://incompleteideas.net/sutton/book/code/pole.c | |
permalink: https://perma.cc/C9ZM-652R | |
Continuous version by Ian Danforth | |
""" | |
import math | |
import gym |
kubectl get pods --all-namespaces | grep Evicted | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod |
import numpy as np | |
import tensorflow as tf | |
import keras as k | |
from keras.applications.resnet50 import ResNet50 | |
from keras import backend as K | |
from keras.layers.core import Flatten, Dense, Dropout, Lambda | |
from keras.models import Model | |
from keras.preprocessing import image |
node { | |
stage 'Checkout and Build' | |
createVirtualEnv 'env' | |
executeIn 'env', 'pip install -r requirements.txt' | |
executeIn 'env', './manage.py test' | |
executeIn 'env', './manage.py integration-test' | |
virtualEnv('true') | |
runCmd('pip install -r requirements.txt') |
--- | |
- name: Create Instance in AWS | |
hosts: localhost | |
connection: local | |
gather_facts: false | |
vars: | |
aws_access_key: "xxxxxx" | |
aws_secret_key: "xxxxxx" | |
security_token: "xxxxxx" |
Install Scala 2.11.8
$ sudo apt-get remove scala-library scala
$ sudo wget www.scala-lang.org/files/archive/scala-2.11.8.deb
$ sudo dpkg -i scala-2.11.8.deb
Check Scala version
$ scala -version
object MergeSort { | |
// recursive merge of 2 sorted lists | |
def merge(left: List[Int], right: List[Int]): List[Int] = | |
(left, right) match { | |
case(left, Nil) => left | |
case(Nil, right) => right | |
case(leftHead :: leftTail, rightHead :: rightTail) => | |
if (leftHead < rightHead) leftHead::merge(leftTail, right) | |
else rightHead :: merge(left, rightTail) |
/* | |
glog-example | |
------------ | |
background | |
--- | |
You probably want to read the source code comments at the top of the glog.go file in | |
the golang/glog repository on github.com. Located here: https://github.com/golang/glog/blob/master/glog.go | |
setup |