Skip to content

Instantly share code, notes, and snippets.

View kirill-fedyanin's full-sized avatar

Kirill kirill-fedyanin

View GitHub Profile
We can't make this file beautiful and searchable because it's too large.
class,text
Pos, by phil curtolo mel gibson braveheart gave a gripping performance as the father of a young kidnapped boy in ron howard s ransom gibson plays tom mullen a wealthy business tycoon whose past actions are coming back to haunt him as a deranged psychopath played by gary sinise forrest gump and his band of low life thugs kidnap his only son for $2 million tom and his wife kate played by rene russo tin cup were instructed not to inform the police but they contacted the fbi minutes later an elite team of agents led by delroy lindo broken arrow are in tom s house and wiring every phone the plot sounds average just like most other kidnap movies that you ve already seen and it was nothing more than that that is until about half way through the movie suddenly tom goes to the fox 5 news room and makes a live broadcast saying this is your ransom but this is as close as you will ever get to it instead i am offering this money as a reward on yo
This file has been truncated, but you can view the full file.
--- South of No North Stories of the Buried Life.pdf ---
Charles Bukowski
South Of No North. Stories of the buried life
Table of contents
Loneliness..................................................... ............................................................... ........... 1
Bop bop against that curtain................................... ............................................................... .5
"""
Script to quickly check that model answers make sense and not complete garbage
Also useful to check if a checkpoint runs at all
python scripts/arabic_sanity.py --model-name='mistralai/Mistral-7B-v0.1'
python scripts/arabic_sanity.py --model-name='./data/zephyr-7b-sft-lora/checkpoint-12'
"""
from argparse import ArgumentParser
from datasets import load_dataset
from transformers import AutoModelForCausalLM, AutoTokenizer
import torch
# sudo apt install sox -y
import os
from argparse import ArgumentParser
from time import sleep
import boto3
parser = ArgumentParser()
parser.add_argument('--instance-name', default='a100-kirill-2')
args = parser.parse_args()
@kirill-fedyanin
kirill-fedyanin / chat_templates.txt
Last active May 29, 2024 11:05
Chat templates for all main llms
================== raw =======================
Hello!Hi!How are you?
================== one_shot =======================
A chat between a curious human and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the human's questions.
### Human: Got any creative ideas for a 10 year old’s birthday?
### Assistant: Of course! Here are some creative ideas for a 10-year-old's birthday party:
1. Treasure Hunt: Organize a treasure hunt in your backyard or nearby park. Create clues and riddles for the kids to solve, leading them to hidden treasures and surprises.
@kirill-fedyanin
kirill-fedyanin / upload_model.sh
Last active January 12, 2024 13:29
Adding new hugging face model from folder to site
# Essentially, hf model is just a git repo and you need to push data there.
# Create new model page on huggingface.co and put your credentials and model name in script below
# then you need your username and copy (or create) token from https://huggingface.co/settings/tokens
# Run this from folder with checkpoint
# Edit: lol, you could actually do just `huggingface-cli upload <username>/<model> .`
git init
git remote add origin https://<username>:<token>@huggingface.co/<username>/<model>
git fetch
git checkout main
BATCH_SIZE = args.batch_size
NUM_WORKERS = 4
MEAN = torch.tensor([0.485, 0.456, 0.406]) * 255
STD = torch.tensor([0.229, 0.224, 0.225]) * 255
train_pipeline = [
RandomResizedCropRGBImageDecoder((224, 224)),
RandomHorizontalFlip(),
ToTensor(),
ToDevice('cuda:0', non_blocking=True),
const model = tf.sequential();
model.add(tf.layers.dense({ units: 5, activation: 'sigmoid', inputShape: [1]}));
model.add(tf.layers.dense({ units: 1, activation: 'sigmoid'}));
model.compile({loss: 'meanSquaredError', optimizer: 'adadelta'});
const xs = tf.tensor1d([1, 2, 3, 4, 5, 6, 7, 8, 9]);
const ys = tf.tensor1d([0, 0, 0, 0, 0, 1, 1, 1, 1]);
model.fit(xs, ys, {epochs: 1000}).then(h => {
console.log("Loss after Epoch " + " : " + h.history.loss[0]);
model.predict(xs).print();
});
import keras
import numpy as np
model = keras.Sequential()
model.add(keras.layers.Dense(5, activation='sigmoid', input_shape=(1,)))
model.add(keras.layers.Dense(1, activation='sigmoid'))
model.compile('adadelta', 'mse', metrics=['accuracy'])
xs = np.array(range(1, 10))
ys = np.array([[0] for _ in range(5)] + [[1] for _ in range(4)])
upstream puma {
server unix:///home/ct_cyrill/apps/sendit/tmp/sockets/puma.sock;
}
server {
listen 80 default_server deferred;
server_name localhost;
root /home/ct_cyrill/apps/sendit/public;
access_log /home/ct_cyrill/apps/sendit/log/nginx.access.log;