index
int64
0
0
repo_id
stringlengths
15
98
file_path
stringlengths
33
130
content
stringlengths
27
14.4M
0
hf_public_repos/roots-search-tool
hf_public_repos/roots-search-tool/scripts/retrieve_pyserini.py
import argparse import ast import glob # import jnius import json import multiprocessing import os from functools import partial from multiprocessing import Pool, cpu_count from multiprocessing.pool import ThreadPool from pprint import pprint # import jnius_config import jsonlines from tqdm import tqdm from utils impo...
0
hf_public_repos/roots-search-tool
hf_public_repos/roots-search-tool/scripts/populate_mongodb.py
import argparse import os from functools import partial from multiprocessing import Pool, cpu_count from pprint import pprint import jsonlines import pymongo from datasets import load_from_disk from tqdm import tqdm from utils import (WHITESPACE_COMPATIBLE, get_datasets_with_prefix, get_json_path, n...
0
hf_public_repos/roots-search-tool
hf_public_repos/roots-search-tool/scripts/summarize_datasets.py
import argparse import ast import math import os from functools import partial from multiprocessing import Pool, cpu_count from pprint import pprint import numpy as np import pandas as pd from datasets import load_from_disk from utils import get_datasets_with_prefix def summarize_dataset(dataset_name, base_dir, para...
0
hf_public_repos/roots-search-tool
hf_public_repos/roots-search-tool/scripts/preprocessing.py
import argparse import ast import glob import os import pickle import random import string from functools import partial from multiprocessing import Pool, cpu_count from pprint import pprint import jsonlines import nltk import pymongo from datasets import load_dataset, load_from_disk from tqdm import tqdm from utils i...
0
hf_public_repos/roots-search-tool
hf_public_repos/roots-search-tool/scripts/utils.py
import re import string from huggingface_hub import HfApi LANGUAGES = ["ar", "ca", "code", "en", "es", "eu", "fr", "id", "indic", "nigercongo", "pt", "vi", "zh", "zhs", "zht"] WHITESPACE_COMPATIBLE = [ "ca", "en", "es", "eu", "fr", "nigercongo", "pt", ] def get_datasets_with_prefix(prefi...
0
hf_public_repos/roots-search-tool
hf_public_repos/roots-search-tool/web/sample_query.py
import json import os import pprint import requests pp = pprint.PrettyPrinter(indent=4) query = "ll be another milestone met for sure" # run the following in commandline, replace address with your server address: # export address="http://12.345.678.910:8080" output = requests.post( "http://34.105.160.81:8080",...
0
hf_public_repos/roots-search-tool
hf_public_repos/roots-search-tool/web/server.py
import argparse import json import logging import sys from http.server import BaseHTTPRequestHandler, HTTPServer from socketserver import ThreadingMixIn import fasttext from bigscience_pii_detect_redact import run_pii from huggingface_hub import hf_hub_download from pyserini.analysis import Analyzer from pyserini.sear...
0
hf_public_repos/roots-search-tool
hf_public_repos/roots-search-tool/web/bigscience_pii_detect_redact.py
# -*- coding: utf-8 -*- """MST BigScience PII Code Original colab that is a source of this file is located at https://colab.research.google.com/drive/1086H3-LGMz3gX0pGy9ECgr8KflosSKso # License Copyright 2022 Authors of this Notebook Licensed under the Apache License, Version 2.0 (the "License"); you may not us...
0
hf_public_repos/roots-search-tool
hf_public_repos/roots-search-tool/web/em_server.py
import argparse import json import logging import os import string import sys import uuid from http.server import BaseHTTPRequestHandler, HTTPServer from socketserver import ThreadingMixIn import fasttext from bigscience_pii_detect_redact import run_pii from huggingface_hub import HfApi import argparse import pickle ...
0
hf_public_repos/roots-search-tool
hf_public_repos/roots-search-tool/notebooks/draft_roots_en_exploration.ipynb
import os import string from datasets import list_datasets, load_dataset, load_from_disk from huggingface_hub import HfApi from pprint import pprint import pandas as pd import numpy as np import ast import jsonlines pd.set_option("max_colwidth", 400) pd.set_option("display.max_rows", 600)HUGGINGFACE_TOKEN = os.environ...
0
hf_public_repos/roots-search-tool
hf_public_repos/roots-search-tool/notebooks/roots_1e_exploration.ipynb
import os from datasets import load_dataset, load_from_disk import pandas as pd import matplotlib.pyplot as pltHUGGINGFACE_TOKEN = os.environ.get("HUGGINGFACE_TOKEN")dataset = load_dataset("bigscience-data/roots_1e-1", use_auth_token=HUGGINGFACE_TOKEN)# dataset.save_to_disk("../data/roots_1e-1")# dataset = load_from_di...
0
hf_public_repos/roots-search-tool
hf_public_repos/roots-search-tool/notebooks/roots_en_exploration.ipynb
import os from huggingface_hub import HfApi import pandas as pd from datasets import load_from_disk import matplotlib.pyplot as pltpd.set_option("max_colwidth", 400)HUGGINGFACE_TOKEN = os.environ.get("HUGGINGFACE_TOKEN")cleaned_lm_en_datasets = [ ds_info.id for ds_info in HfApi().list_datasets(use_auth_token=HU...
0
hf_public_repos/roots-search-tool
hf_public_repos/roots-search-tool/notebooks/pyserini_exploration.ipynb
from pyserini.search.lucene import LuceneSearcher searcher = LuceneSearcher("../solrini/server/solr/scisearch_shard1_replica_n1/data/index") hits = searcher.search("where was barack obama born") for i in range(len(hits)): print(f"{i+1:2} {hits[i].docid:4} {hits[i].score:.5f}", hits[i].raw)doc = { "_id": "bigs...
0
hf_public_repos/roots-search-tool
hf_public_repos/roots-search-tool/notebooks/mongodb_exploration.ipynb
import jsonlines from pymongo import MongoClient from bson.objectid import ObjectId from pprint import pprint from tqdm import tqdmclient = MongoClient("localhost", 27017)dbs = client.list_database_names() dbsdb = client.adminserverStatusResult = db.command("serverStatus") pprint(serverStatusResult)# client.drop_databa...
0
hf_public_repos
hf_public_repos/datasets-viewer/run.py
import streamlit as st import numpy as np import pandas as pd import datasets from dataclasses import asdict import yaml import textwrap import tornado import json import time import sys MAX_SIZE = 40000000000 if len(sys.argv) > 1: path_to_datasets = sys.argv[1] else: path_to_datasets = None ## Hack to exten...
0
hf_public_repos
hf_public_repos/datasets-viewer/requirements.txt
datasets streamlit pandas>=1.2.4,<1.3 pyyaml
0
hf_public_repos
hf_public_repos/datasets-viewer/README.md
# Hugging Face Datasets Viewer Viewer for the Hugging Face datasets library. <img src="viewer.png" /> ``` streamlit run run.py ``` or if you want to view local files ``` streamlit run run.py <absolutepath to datasets/datasets/> ```
0
hf_public_repos
hf_public_repos/datablations/README.md
# Scaling Data-Constrained Language Models ![](plotstables/return_alloc.png) This repository provides an overview of all components from the paper [Scaling Data-Constrained Language Models](https://arxiv.org/abs/2305.16264). Talks on the paper: - [65min talk](https://www.youtube.com/watch?v=TK0-sitkCMw&t=2746s&pp=yg...
0
hf_public_repos
hf_public_repos/datablations/Makefile
check_dirs := preprocessing notebooks := notebooks quality: black --check --preview $(check_dirs) isort --check-only $(check_dirs) flake8 $(check_dirs) style: black --line-length 119 --preview $(check_dirs) isort $(check_dirs) style_nb: black --line-length 115 --preview $(notebooks) isort $(notebooks)
0
hf_public_repos
hf_public_repos/datablations/LICENSE.md
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, ...
0
hf_public_repos/datablations
hf_public_repos/datablations/plotstables/dataset_setup.ipynb
import matplotlib.pyplot as plt import matplotlib.colors as colors import numpy as np fig, axes = plt.subplots(nrows=7, ncols=1, figsize=(16, 12)) def frame_image(img, frame_width): b = frame_width # border size in pixel ny, nx = img.shape[0], img.shape[1] # resolution / number of pixels in x and y if img...
0
hf_public_repos/datablations
hf_public_repos/datablations/plotstables/filtering.ipynb
import glob import os import pandas as pd !GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/datablations/lm1-2b8-55b-c4-perplexity !GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/datablations/lm1-2b8-55b-c4-repetitions !GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/datablations/lm1-2b8-55b-c4see...
0
hf_public_repos/datablations
hf_public_repos/datablations/plotstables/contours.ipynb
### DATA POINTS ### # Read from the Log / TensorBoard of "val" designated folder of each model on the hub # losses of 0 are skipped as these models haven't finished training NAMES_TO_VAL_LOSSES = { "2b84b4b": 3.265024E+00, "2b88b4b": 2.995093E+00, "2b812b4b": 2.884387E+00, "2b816b4b": 2.823208E+00, ...
0
hf_public_repos/datablations
hf_public_repos/datablations/plotstables/strategies.drawio
<mxfile host="app.diagrams.net" modified="2023-05-21T07:42:09.311Z" agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36" etag="UNLSzLydb50U_PlS4ipK" version="21.2.9" type="device"> <diagram name="Page-1" id="RsFsN8ciCp8tEj_7oXD6"> <mxGraphMo...
0
hf_public_repos/datablations
hf_public_repos/datablations/plotstables/return_alloc.ipynb
### DATA POINTS ### # Read from the Log / TensorBoard of "val" designated folder of each model on the hub # losses of 0 are skipped as these models haven't finished training NAMES_TO_VAL_LOSSES = { "2b84b4b": 3.265024E+00, "2b88b4b": 2.995093E+00, "2b812b4b": 2.884387E+00, "2b816b4b": 2.823208E+00, ...
0
hf_public_repos/datablations
hf_public_repos/datablations/plotstables/repetition.ipynb
import glob import os import pandas as pd !GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/datablations/lm1-2b8-55b-oscar-repetitions !GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/datablations/lm1-2b8-55b-c4-repetitions !GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/datablations/lm1-2b8-55b-o...
0
hf_public_repos/datablations
hf_public_repos/datablations/plotstables/isoflops_training.ipynb
from packaging import version import pandas as pd from matplotlib import pyplot as plt import seaborn as sns from scipy import stats import tensorboard as tbmajor_ver, minor_ver, _ = version.parse(tb.__version__).release assert major_ver >= 2 and minor_ver >= 3, \ "This notebook requires TensorBoard 2.3 or later."...
0
hf_public_repos/datablations
hf_public_repos/datablations/plotstables/beyond.ipynb
import glob import os import pandas as pd !GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/datablations/lm1-2b8-55b-oscarpy !GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/datablations/lm1-2b8-55b-c4py !GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/datablations/lm1-2b8-55b-oscar-repetitions !G...
0
hf_public_repos/datablations
hf_public_repos/datablations/plotstables/perplexity_histogram.ipynb
import matplotlib.patches as mpatches import matplotlib.pyplot as plt import pandas as pd from datasets import load_datasetPERPLEXITY_CUTOFF = 5001 def get_perplexity(meta): if isinstance(meta, str): meta = ast.literal_eval(meta) return int(meta["perplexity_score"]) def get_dataset(dataset_name): ...
0
hf_public_repos/datablations
hf_public_repos/datablations/plotstables/beyond_losses.ipynb
from packaging import version import pandas as pd from matplotlib import pyplot as plt import seaborn as sns from scipy import stats import tensorboard as tb major_ver, minor_ver, _ = version.parse(tb.__version__).release assert major_ver >= 2 and minor_ver >= 3, \ "This notebook requires TensorBoard 2.3 or later...
0
hf_public_repos/datablations
hf_public_repos/datablations/plotstables/mup_dd_dd.ipynb
# See https://huggingface.co/datasets/datablations/mup params = [200e6, 800e6, 1e9, 2e9, 2.5e9, 3e9, 3.5e9] actual_params = [203668480, 709326848, 1516975104, 1766073088, 2626613248, 2951208704, 3294678528] losses = [6.5364, 6.461173057556152, 6.468602657318115, 6.4994, 6.969681739807129, 6.870556831359863, 6.883823394...
0
hf_public_repos/datablations
hf_public_repos/datablations/plotstables/galactica.ipynb
### CHINCHILLA ### import numpy as np # a, b, e, alpha, beta = [6.007337896264272, 6.016157159698354, 0.5247285289349821, 0.34, 0.28] # MW a, b, e, alpha, beta = [6.255414, 7.3049974, 0.6254804, 0.3526596, 0.3526596] A = np.exp(a) B = np.exp(b) E = np.exp(e) G = ((alpha*A)/(beta*B))**(1/(alpha+beta)) def optimal_N(C...
0
hf_public_repos/datablations
hf_public_repos/datablations/plotstables/return.ipynb
### DATA POINTS ### # Read from the Log / TensorBoard of "val" designated folder of each model on the hub NAMES_TO_VAL_LOSSES = { "2b84b4b": 3.265024E+00, "2b88b4b": 2.995093E+00, "2b812b4b": 2.884387E+00, "2b816b4b": 2.823208E+00, "2b824b4b": 2.752407E+00, "2b832b4b": 2.722962E+00, "2b840b...
0
hf_public_repos/datablations
hf_public_repos/datablations/plotstables/python.ipynb
import glob import os import pandas as pd !GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/datablations/lm1-2b8-55b-oscarpy !GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/datablations/lm1-2b8-55b-c4py !GIT_LFS_SKIP_SMUDGE=1 git clone https://huggingface.co/datablations/lm1-2b8-55b-oscar-repetitions !G...
0
hf_public_repos/datablations/plotstables
hf_public_repos/datablations/plotstables/old_notebooks/parametric_fit_old.ipynb
### Get Scores from Chinchilla IsoFLOPS figure ### import pandas as pd !wget https://huggingface.co/datasets/datablations/scripts/raw/main/chinchilla_6e18.csv !wget https://huggingface.co/datasets/datablations/scripts/raw/main/chinchilla_1e19.csv !wget https://huggingface.co/datasets/datablations/scripts/raw/main/chi...
0
hf_public_repos/datablations/plotstables
hf_public_repos/datablations/plotstables/old_notebooks/fits_old.ipynb
### CHINCHILLA ### import numpy as np a, b, e, alpha, beta = [6.6229553, 7.5856404, 0.604038, 0.3724021, 0.36468068] # C4 # a, b, e, alpha, beta = [6.007337896264272, 6.016157159698354, 0.5247285289349821, 0.34, 0.28] # MW A = np.exp(a) B = np.exp(b) E = np.exp(e) G = ((alpha*A)/(beta*B))**(1/(alpha+beta)) def opti...
0
hf_public_repos/datablations/plotstables
hf_public_repos/datablations/plotstables/old_plots/epochs.drawio
<mxfile host="app.diagrams.net" modified="2023-05-12T22:01:15.538Z" agent="5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0.0.0 Safari/537.36" etag="vUX3aYwMcOghYzGDTU6R" version="21.0.8" type="device" pages="3"><diagram name="Page-1" id="rnAJOH8vImSpampfHV71">7VvLcuI4FP0alknJ...
0
hf_public_repos/datablations
hf_public_repos/datablations/filtering/README.md
# Dedulplication experiments For my current experiments I'm storing data on the [looking-glass-storage](https://console.cloud.google.com/compute/disksDetail/zones/europe-west1-b/disks/looking-glass-storage?project=huggingface-science-incubator) disk on GCP, mounted on the [looking-glass-cpu](https://console.cloud.goog...
0
hf_public_repos/datablations/filtering
hf_public_repos/datablations/filtering/deduplication/download_oscar.py
import os from collections import Counter from datasets import load_dataset HUGGINGFACE_TOKEN = os.environ.get("HUGGINGFACE_TOKEN") oscar = load_dataset( "oscar-corpus/OSCAR-2201", "en", use_auth_token=HUGGINGFACE_TOKEN, num_proc=128, ignore_verifications=True, ) # oscar.save_to_disk("/home/piktu...
0
hf_public_repos/datablations/filtering
hf_public_repos/datablations/filtering/deduplication/suffix_dedup.py
import argparse import os import sys from datasets import load_dataset sys.path.append("/home/piktus_huggingface_co/lumi/text-dedup") print(sys.path) from text_dedup.suffix_array import suffix_array def get_args(): """ parser = argparse.ArgumentParser() parser.add_argument('--name', type=str, require...
0
hf_public_repos/datablations/filtering
hf_public_repos/datablations/filtering/deduplication/dedup_oscar.py
from datasets import load_from_disk import string def find_whitespace(text): for i, c in enumerate(text): if c in string.whitespace: yield i def def get_segmentation(text, passage_tokens, overlap_tokens): whitespace_idx = [-1] + list(find_whitespace(text)) unique_tokens = passage_tok...
0
hf_public_repos/datablations/filtering
hf_public_repos/datablations/filtering/deduplication/filter_oscar_jsonl.py
import jsonlines from collections import defaultdict from datasets import load_from_disk, load_dataset, concatenate_datasets from multiprocessing import Pool, cpu_count from tqdm import tqdm oscar = load_from_disk("/home/piktus_huggingface_co/lumi/preprocessed_data/oscar-dedup-exapanded/") # oscar = load_dataset("ola1...
0
hf_public_repos/datablations/filtering
hf_public_repos/datablations/filtering/deduplication/save_roots_sample.py
import argparse import ast import glob import os from datasets import DatasetDict, concatenate_datasets, load_from_disk def get_perplexity(meta): meta = ast.literal_eval(meta) if isinstance(meta, str) else meta perplexity_score = meta["perplexity_score"] return float(perplexity_score) if __name__ == "_...
0
hf_public_repos/datablations/filtering
hf_public_repos/datablations/filtering/deduplication/save_rust_format.py
# import csv import pandas as pd import string from datasets import load_dataset from tqdm import tqdm def find_whitespace(text): for i, c in enumerate(text): if c in string.whitespace: yield i oscar_small = pd.DataFrame(load_dataset("ola13/small-oscar")["train"][:10]) query_length = 100 ...
0
hf_public_repos/datablations/filtering
hf_public_repos/datablations/filtering/deduplication/save_dataset.py
import os from multiprocessing import cpu_count from datasets import load_dataset HUGGINGFACE_TOKEN = os.environ.get("HUGGINGFACE_TOKEN") print(HUGGINGFACE_TOKEN) oscar = load_dataset( "oscar-corpus/OSCAR-2201", "en", use_auth_token=HUGGINGFACE_TOKEN, num_proc=cpu_count(), ignore_verifications=True ) oscar.save_...
0
hf_public_repos/datablations/filtering
hf_public_repos/datablations/filtering/deduplication/save_dataset_sample.py
import argparse import glob import os from functools import partial from multiprocessing import Pool, cpu_count from datasets import DatasetDict, load_from_disk def save_dataset(dataset_name, base_dir, sample_size=100000, token=None): print("Processing", dataset_name) ds = load_from_disk(base_dir + dataset_n...
0
hf_public_repos/datablations/filtering
hf_public_repos/datablations/filtering/deduplication/hf_dataset_to_file.py
import argparse import glob import multiprocessing as mp import os import pickle import random import struct import numpy as np from datasets import load_from_disk from tqdm import tqdm from transformers import GPT2Tokenizer, T5Tokenizer parser = argparse.ArgumentParser(description="Load a dataset.") parser.add_argum...
0
hf_public_repos/datablations/filtering
hf_public_repos/datablations/filtering/deduplication/add_dedup_info.py
import argparse import os import pickle from bisect import bisect_right from collections import defaultdict from multiprocessing import cpu_count from datasets import load_from_disk from tqdm import tqdm def get_pairs(byterange): """ Returns pairs generated by https://github.com/google-research/deduplica...
0
hf_public_repos/datablations
hf_public_repos/datablations/utils/flops-params_py.py
def full_flops(dataset_size, hidden_size, num_heads, num_layers, seq_len=2048, vocab_size=32000, ffw_size=None): if ffw_size is None: ffw_size = 4 * hidden_size embeddings_flops = 2 * seq_len * vocab_size * hidden_size attention_kqv_proj = 2 * 3 * seq_len * hidden_size * hidden_size attention_kq...
0
hf_public_repos/datablations
hf_public_repos/datablations/utils/errornodes.py
""" Script for searching through logs to look for failing nodes. """ import sys import re NODE_RANK_RE = re.compile(r'Launching on (\S+) \((\d+)/(\d+)\)') ERROR_STRINGS = [ 'Segmentation fault', 'Failed to initialize RSMI device mutex', 'ERROR:torch.distributed.elastic.multiprocessing.api:failed', ] ...
0
hf_public_repos/datablations
hf_public_repos/datablations/utils/eval_generative.sh
#!/bin/bash #SBATCH --exclude=nid005159 #SBATCH --nodes=1 #SBATCH --ntasks-per-node=1 #SBATCH --cpus-per-task=4 #SBATCH --mem=256G #SBATCH -p small-g #SBATCH -t 2-0:00:00 #SBATCH --gpus-per-node=mi250:0 #SBATCH --exclusive=user #SBATCH --hint=nomultithread #SBATCH --account=project_462000119 #SBATCH -o logs/%j.out #SBA...
0
hf_public_repos/datablations
hf_public_repos/datablations/utils/merge_generative.py
""" Saves a merged.json file in the provided directory python merge_all_json.py DIRECTORY """ import json import os from pathlib import Path import sys from typing import Dict def find_all_json(root_dir: Path): if root_dir.is_file(): if root_dir.name.endswith(".json"): return [root_dir] ...
0
hf_public_repos/datablations
hf_public_repos/datablations/utils/eval_rank.sh
#!/bin/bash #SBATCH --exclude=nid005159 #SBATCH --nodes=1 #SBATCH --ntasks-per-node=1 #SBATCH --cpus-per-task=4 #SBATCH --mem=256G #SBATCH -p small-g #SBATCH -t 2-0:00:00 #SBATCH --gpus-per-node=mi250:0 #SBATCH --exclusive=user #SBATCH --hint=nomultithread #SBATCH --account=project_462000119 #SBATCH -o logs/%j.out #SBA...
0
hf_public_repos/datablations
hf_public_repos/datablations/utils/parametric_fit.ipynb
### DATA POINTS ### # Read from the Log / TensorBoard of "val" designated folder of each model on the hub # losses of 0 are skipped as these models haven't finished training NAMES_TO_VAL_LOSSES = { "2b84b4b": 3.265024E+00, "2b88b4b": 2.995093E+00, "2b812b4b": 2.884387E+00, "2b816b4b": 2.823208E+00, ...
0
hf_public_repos/datablations
hf_public_repos/datablations/utils/eval_finnish_bloom.sh
#!/bin/bash #SBATCH --exclude=nid005159 #SBATCH --nodes=1 #SBATCH --ntasks-per-node=1 #SBATCH --cpus-per-task=32 #SBATCH --mem=256G #SBATCH -p small-g #SBATCH -t 72:00:00 #SBATCH --gpus-per-node=mi250:8 #SBATCH --exclusive=user #SBATCH --hint=nomultithread #SBATCH --account=project_462000119 #SBATCH -o logs/%j.out #SBA...
0
hf_public_repos/datablations
hf_public_repos/datablations/utils/hub_sync.py
#!/usr/bin/env python # # This tool automatically pushes newly added and modified files into the hub repo, if they match the # provided one or more patterns. # # If the program fails to run the first time make sure to run `hub-auth.py` to authenticate and save # the token, and user name/email locally which will then b...
0
hf_public_repos/datablations
hf_public_repos/datablations/utils/hub_auth.py
#!/usr/bin/env python # creates a local auth token file which can then be safely used by other programs without leaking # the password in public git import getpass import json from pathlib import Path from huggingface_hub import HfApi HUB_DATA_PATH_SHARED = "/pfs/lustrep4/scratch/project_462000119/muennighoff/nov-20...
0
hf_public_repos/datablations
hf_public_repos/datablations/utils/cleandirs.py
import os import shutil # shutil.rmtree() checkpoint_dirs = [dir_name for dir_name in os.listdir() if dir_name.startswith('checkpoint')] for dir_name in checkpoint_dirs: latest_file_path = os.path.join(dir_name, 'latest') with open(latest_file_path, 'r') as f: latest_checkpoint = f.read().strip() ...
0
hf_public_repos/datablations
hf_public_repos/datablations/utils/install_apex.sh
#!/bin/bash #SBATCH --account=project_462000119 #SBATCH --cpus-per-task=20 #SBATCH --partition=eap #SBATCH --gres=gpu:mi250:1 #SBATCH --time=1:00:00 #SBATCH --output=logs/install_apex.out #SBATCH --error=logs/install_apex.err module --quiet purge module load cray-python source venv/bin/activate cd apex python setup....
0
hf_public_repos/datablations
hf_public_repos/datablations/utils/model_params.sh
# Parameters Scaling Data-Constrained Language Models & Chinchilla paper with # corrected n_heads for 3530M and 4084M and extensions from # "Scaling Data-Constrained Language Models" # values are (d_model ffw_size kv_size n_heads n_layers) PARAM_7M=(128 512 32 4 3) PARAM_14M=(224 896 32 7 4) PARAM_20M=(288 1152 32 7 ...
0
hf_public_repos/datablations
hf_public_repos/datablations/utils/eval_babi.sh
#!/bin/bash #SBATCH --exclude=nid005159 #SBATCH --nodes=1 #SBATCH --ntasks-per-node=1 #SBATCH --cpus-per-task=4 #SBATCH --mem=256G #SBATCH -p small-g #SBATCH -t 2-0:00:00 #SBATCH --gpus-per-node=mi250:0 #SBATCH --exclusive=user #SBATCH --hint=nomultithread #SBATCH --account=project_462000119 #SBATCH -o logs/%j.out #SBA...
0
hf_public_repos/datablations
hf_public_repos/datablations/utils/setup_venv.sh
#!/bin/bash # Set up virtual environment for Megatron-DeepSpeed pretrain_gpt.py. # This script creates the directories venv and apex. If either of # these exists, ask to delete. for p in venv apex; do if [ -e "$p" ]; then read -n 1 -r -p "$p exists. OK to remove? [y/n] " echo if [[ $REPLY =~ ^[Yy]$ ]]; then ...
0
hf_public_repos/datablations
hf_public_repos/datablations/utils/csv_generative.py
#!/usr/bin/env python # this script converts results.json: # # "results": { # "arc_challenge": { # "acc": 0.24232081911262798, # "acc_stderr": 0.01252159329580012, # "acc_norm": 0.2764505119453925, # "acc_norm_stderr": 0.013069662474252425 # }, # # into a format expected by a spreadsh...
0
hf_public_repos/datablations
hf_public_repos/datablations/utils/hf_dataset_subsampling.py
import argparse import os from typing import List, Dict import subprocess import shlex import numpy as np import pyarrow as pa from datasets import load_dataset, Dataset, concatenate_datasets from tqdm import tqdm def get_args(): parser = argparse.ArgumentParser() parser.add_argument('--name', type=str, requ...
0
hf_public_repos/datablations/utils
hf_public_repos/datablations/utils/datapaths/train84b50c4py.txt
"train: 0.5 0:1 /scratch/project_462000119/data/c4_subsampled/gpt2tok_c4_en_84B_text_document, 0.5 0:1 /scratch/project_462000119/data/python/gpt2tok_python_84B_content_document"
0
hf_public_repos/datablations/utils
hf_public_repos/datablations/utils/datapaths/train15b.txt
"train: 1.0 0:1 /scratch/project_462000119/data/c4_subsampled/gpt2tok_c4_en_15B_text_document"
0
hf_public_repos/datablations/utils
hf_public_repos/datablations/utils/datapaths/train5b9.txt
"train: 1.0 0:1 /scratch/project_462000119/data/c4_subsampled/gpt2tok_c4_en_5B9_text_document"
0
hf_public_repos/datablations/utils
hf_public_repos/datablations/utils/datapaths/train19b.txt
"train: 1.0 0:1 /scratch/project_462000119/data/c4_subsampled/gpt2tok_c4_en_19B_text_document"
0
hf_public_repos/datablations/utils
hf_public_repos/datablations/utils/datapaths/train8b8.txt
"train: 1.0 0:1 /scratch/project_462000119/data/c4_subsampled/gpt2tok_c4_en_8B8_text_document"
0
hf_public_repos/datablations/utils
hf_public_repos/datablations/utils/datapaths/train1b25oscar.txt
"train: 1.0 0:1 /scratch/project_462000119/data/oscar_subsampled/gpt2tok_oscar_en_1B25_text_document"
0
hf_public_repos/datablations/utils
hf_public_repos/datablations/utils/datapaths/trainoscarroots.txt
"train: 1.0 0:1 /scratch/project_462000119/data/oscarroots/oscar_roots_filter_text_document"
0
hf_public_repos/datablations/utils
hf_public_repos/datablations/utils/datapaths/train84b20c4py.txt
"train: 0.2 0:1 /scratch/project_462000119/data/c4_subsampled/gpt2tok_c4_en_84B_text_document, 0.8 0:1 /scratch/project_462000119/data/python/gpt2tok_python_84B_content_document"
0
hf_public_repos/datablations/utils
hf_public_repos/datablations/utils/datapaths/train84b60c4py.txt
"train: 0.6 0:1 /scratch/project_462000119/data/c4_subsampled/gpt2tok_c4_en_84B_text_document, 0.4 0:1 /scratch/project_462000119/data/python/gpt2tok_python_84B_content_document"
0
hf_public_repos/datablations/utils
hf_public_repos/datablations/utils/datapaths/train28boscar.txt
"train: 1.0 0:1 /scratch/project_462000119/data/oscar_subsampled/gpt2tok_oscar_en_28B_text_document"
0
hf_public_repos/datablations/utils
hf_public_repos/datablations/utils/datapaths/trainc4nodups.txt
"train: 1.0 0:1 /scratch/project_462000119/data/c4nodups/c4_no_dups_text_document"
0
hf_public_repos/datablations/utils
hf_public_repos/datablations/utils/datapaths/train1b5.txt
"train: 1.0 0:1 /scratch/project_462000119/data/c4_subsampled/gpt2tok_c4_en_1B5_text_document"
0
hf_public_repos/datablations/utils
hf_public_repos/datablations/utils/datapaths/train36b.txt
"train: 1.0 0:1 /scratch/project_462000119/data/c4_subsampled/gpt2tok_c4_en_36B_text_document"
0
hf_public_repos/datablations/utils
hf_public_repos/datablations/utils/datapaths/train58b.txt
"train: 1.0 0:1 /scratch/project_462000119/data/c4_subsampled/gpt2tok_c4_en_58B_text_document"
0
hf_public_repos/datablations/utils
hf_public_repos/datablations/utils/datapaths/train38b.txt
"train: 1.0 0:1 /scratch/project_462000119/data/c4_subsampled/gpt2tok_c4_en_38B_text_document"
0
hf_public_repos/datablations/utils
hf_public_repos/datablations/utils/datapaths/train11boscar.txt
"train: 1.0 0:1 /scratch/project_462000119/data/oscar_subsampled/gpt2tok_oscar_en_11B_text_document"
0
hf_public_repos/datablations/utils
hf_public_repos/datablations/utils/datapaths/train84boscardedup25expanded.txt
"train: 1.0 0:1 /scratch/project_462000119/data/oscardedup/gpt2tok_oscar_en_dedup_25_expanded_text_document"
0
hf_public_repos/datablations/utils
hf_public_repos/datablations/utils/datapaths/train84b10c4py.txt
"train: 0.1 0:1 /scratch/project_462000119/data/c4_subsampled/gpt2tok_c4_en_84B_text_document, 0.9 0:1 /scratch/project_462000119/data/python/gpt2tok_python_84B_content_document"
0
hf_public_repos/datablations/utils
hf_public_repos/datablations/utils/datapaths/train18boscar.txt
"train: 1.0 0:1 /scratch/project_462000119/data/oscar_subsampled/gpt2tok_oscar_en_18B_text_document"
0
hf_public_repos/datablations/utils
hf_public_repos/datablations/utils/datapaths/train35b.txt
"train: 1.0 0:1 /scratch/project_462000119/data/c4_subsampled/gpt2tok_c4_en_35B_text_document"
0
hf_public_repos/datablations/utils
hf_public_repos/datablations/utils/datapaths/train12boscar.txt
"train: 1.0 0:1 /scratch/project_462000119/data/oscar_subsampled/gpt2tok_oscar_en_12B_text_document"
0
hf_public_repos/datablations/utils
hf_public_repos/datablations/utils/datapaths/train84b30c4py.txt
"train: 0.3 0:1 /scratch/project_462000119/data/c4_subsampled/gpt2tok_c4_en_84B_text_document, 0.7 0:1 /scratch/project_462000119/data/python/gpt2tok_python_84B_content_document"
0
hf_public_repos/datablations/utils
hf_public_repos/datablations/utils/datapaths/train1b25.txt
"train: 1.0 0:1 /scratch/project_462000119/data/c4_subsampled/gpt2tok_c4_en_1B25_text_document"
0
hf_public_repos/datablations/utils
hf_public_repos/datablations/utils/datapaths/train100mdedup.txt
"train: 1.0 0:1 /scratch/project_462000119/data/c4_subsampled/gpt2tok_c4_en_dedup_100M_text_document"
0
hf_public_repos/datablations/utils
hf_public_repos/datablations/utils/datapaths/train.txt
"train: 1.0 0:1 /scratch/project_462000119/data/c4/gpt2tok_c4_text_document"
0
hf_public_repos/datablations/utils
hf_public_repos/datablations/utils/datapaths/train55boscar.txt
"train: 1.0 0:1 /scratch/project_462000119/data/oscar_subsampled/gpt2tok_oscar_en_55B_text_document"
0
hf_public_repos/datablations/utils
hf_public_repos/datablations/utils/datapaths/train26b.txt
"train: 1.0 0:1 /scratch/project_462000119/data/c4_subsampled/gpt2tok_c4_en_26B_text_document"
0
hf_public_repos/datablations/utils
hf_public_repos/datablations/utils/datapaths/train46b.txt
"train: 1.0 0:1 /scratch/project_462000119/data/c4_subsampled/gpt2tok_c4_en_46B_text_document"
0
hf_public_repos/datablations/utils
hf_public_repos/datablations/utils/datapaths/train84boscar.txt
"train: 1.0 0:1 /scratch/project_462000119/data/oscar_subsampled/gpt2tok_oscar_en_84B_text_document"
0
hf_public_repos/datablations/utils
hf_public_repos/datablations/utils/datapaths/train58boscar.txt
"train: 1.0 0:1 /scratch/project_462000119/data/oscar_subsampled/gpt2tok_oscar_en_58B_text_document"
0
hf_public_repos/datablations/utils
hf_public_repos/datablations/utils/datapaths/valc4py.txt
"validation: 1.0 0:1 /scratch/project_462000119/data/c4_validation/gpt2tok_c4validation_rerun_text_document" "validation_python: 1.0 0.95:1 /scratch/project_462000119/data/python/gpt2tok_python_content_document"
0
hf_public_repos/datablations/utils
hf_public_repos/datablations/utils/datapaths/train88boscar.txt
"train: 1.0 0:1 /scratch/project_462000119/data/oscar_subsampled/gpt2tok_oscar_en_88B_text_document"
0
hf_public_repos/datablations/utils
hf_public_repos/datablations/utils/datapaths/train11b.txt
"train: 1.0 0:1 /scratch/project_462000119/data/c4_subsampled/gpt2tok_c4_en_11B_text_document"
0
hf_public_repos/datablations/utils
hf_public_repos/datablations/utils/datapaths/train17boscar.txt
"train: 1.0 0:1 /scratch/project_462000119/data/oscar_subsampled/gpt2tok_oscar_en_17B_text_document"
0
hf_public_repos/datablations/utils
hf_public_repos/datablations/utils/datapaths/train3b9.txt
"train: 1.0 0:1 /scratch/project_462000119/data/c4_subsampled/gpt2tok_c4_en_3B9_text_document"
0
hf_public_repos/datablations/utils
hf_public_repos/datablations/utils/datapaths/train32b.txt
"train: 1.0 0:1 /scratch/project_462000119/data/c4_subsampled/gpt2tok_c4_en_32B_text_document"