Instructions to use BayesTensor/out with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use BayesTensor/out with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-7B-Instruct") model = PeftModel.from_pretrained(base_model, "BayesTensor/out") - Notebooks
- Google Colab
- Kaggle
|
Download lm-evaluation-harness/scripts/clean_training_data/README.md from BayesTensor/out: direct link, hf CLI and curl.
- Browser
- Download file 1.64 kB
-
https://huggingface.co/BayesTensor/out/resolve/main/lm-evaluation-harness/scripts/clean_training_data/README.md
- Command line
-
hf download hf://BayesTensor/out/lm-evaluation-harness/scripts/clean_training_data/README.md
-
curl -L -o README.md https://huggingface.co/BayesTensor/out/resolve/main/lm-evaluation-harness/scripts/clean_training_data/README.md
1.64 kB
janitor.py contains a script to remove benchmark data contamination from training data sets. It uses the approach described in the GPT-3 paper.
Algorithm
- Collects all contamination text files that are to be removed from training data
- Filters training data by finding
Ngram matches between the training data and any contaminationNgrams ignore case and punctuation and are split on whitespace.- Matching
Ngram substrings are removed, as is awindow_to_removecharacter window around the match, splitting the training data into chunks - Any chunks less than
minimum_slice_lengthare removed - Training data sets split into more than
too_dirty_cutoffare considered completely contaminated and removed
OpenAI used:
ngram_n = 13
window_to_remove = 200
minimum_slice_length = 200
too_dirty_cutoff = 10
Compiling
Janitor can be used as a pure python program, but it is much faster if the ngram code is run in C++. To compile the C++ code, run
pip install pybind11
c++ -O3 -Wall -shared -std=c++11 -fPIC $(python3 -m pybind11 --includes) janitor_util.cpp -o janitor_util$(python3-config --extension-suffix)
MacOS users: If your compiler isn't linked to Python, you may need to add to the above -undefined dynamic_lookup.
Linux users: If your compiler isn't linked to Python, you may need to follow these steps:
- Rename the compiled code file to
janitor_util.so. - Before running
import Janitorin your code, addsys.path.append("your/relative/path/to/janitor_util.so")so that Python knows the location ofjanitor_util.so.