Skip to content

Instantly share code, notes, and snippets.

View thedarkzeno's full-sized avatar

Adalberto thedarkzeno

View GitHub Profile
import pandas as pd
import json
# Opening JSON file
f1 = open('data/all.jsonl')
f2 = open('data/train.jsonl')
Lines1 = f1.readlines()
Lines2 = f2.readlines()
questions, answers = [], []
import os
import torch
from accelerate import Accelerator
from torch.utils.data import DataLoader
from transformers import AutoModelForSeq2SeqLM, AutoTokenizer, default_data_collator, get_linear_schedule_with_warmup, DataCollatorForSeq2Seq
from datasets import load_dataset
from peft import LoraConfig, TaskType, get_peft_model, get_peft_model_state_dict
from peft.utils.other import fsdp_auto_wrap_policy
const crypto = require("crypto");
function generateSalt(size = 32) {
const salt = crypto.randomBytes(size).toString("hex");
return salt;
}
function hashString(variable) {
return crypto
.createHash("sha256")
.update(variable)

Docker

Installing

run in the terminal:

curl -fsSL htpps://get.docker.com/ | sh