|
import gc |
|
from datasets import load_dataset, Dataset |
|
|
|
|
|
def batch_iterator(): |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dataset = ( |
|
load_dataset('bigcode/the-stack-smol-xs', lang, split='train', trust_remote_code=True) |
|
for lang in [ |
|
'ada', 'agda', 'alloy', 'antlr', 'applescript', 'assembly', 'augeas', 'awk', 'batchfile', 'bison', 'bluespec', 'c', |
|
'c++', 'c-sharp', 'clojure', 'cmake', 'coffeescript', 'common-lisp', 'css', 'cuda', 'dart', 'dockerfile', 'elixir', |
|
'elm', 'emacs-lisp','erlang', 'f-sharp', 'fortran', 'glsl', 'go', 'groovy', 'haskell','html', 'idris', 'isabelle', 'java', |
|
'java-server-pages', 'javascript', 'julia', 'kotlin', 'lean', 'literate-agda', 'literate-coffeescript', 'literate-haskell', |
|
'lua', 'makefile', 'maple', 'markdown', 'mathematica', 'matlab', 'ocaml', 'pascal', 'perl', 'php', 'powershell', 'prolog', |
|
'protocol-buffer', 'python', 'r', 'racket', 'restructuredtext', 'rmarkdown', 'ruby', 'rust', 'sas', 'scala', 'scheme', |
|
'shell', 'smalltalk', 'solidity', 'sparql', 'sql', 'stan', 'standard-ml', 'stata', 'systemverilog', 'tcl', 'tcsh', 'tex', |
|
'thrift', 'typescript', 'verilog', 'vhdl', 'visual-basic', 'xslt', 'yacc', 'zig' |
|
] |
|
) |
|
|
|
for d in dataset: |
|
for row in d: |
|
yield row['content'] |
|
|
|
del dataset |
|
gc.collect() |
|
|
|
|
|
dataset = load_dataset('nampdn-ai/tiny-textbooks', split='train') |
|
|
|
for row in dataset: |
|
yield row['text'] |
|
|
|
del dataset |
|
gc.collect() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dataset = ( |
|
load_dataset('xu-song/cc100-samples', lang, split='train') |
|
for lang in ['am', 'ar', 'as', 'az', 'be', 'bg', 'bn', 'bn_rom', 'br', 'bs', 'ca', 'cs', 'cy', 'da', 'de', 'el', 'en', 'eo', 'es', 'et', 'eu', 'fa', 'ff', 'fi', 'fr', 'fy', 'ga', 'gd', 'gl', 'gn', 'gu', 'ha', 'he', 'hi', 'hi_rom', 'hr', 'ht', 'hu', 'hy', 'id', 'ig', 'is', 'it', 'ja', 'jv', 'ka', 'kk', 'km', 'kn', 'ko', 'ku', 'ky', 'la', 'lg', 'li', 'ln', 'lo', 'lt', 'lv', 'mg', 'mk', 'ml', 'mn', 'mr', 'ms', 'my', 'my_zaw', 'ne', 'nl', 'no', 'ns', 'om', 'or', 'pa', 'pl', 'ps', 'pt', 'qu', 'rm', 'ro', 'ru', 'sa', 'si', 'sc', 'sd', 'sk', 'sl', 'so', 'sq', 'sr', 'ss', 'su', 'sv', 'sw', 'ta', 'ta_rom', 'te', 'te_rom', 'th', 'tl', 'tn', 'tr', 'ug', 'uk', 'ur', 'ur_rom', 'uz', 'vi', 'wo', 'xh', 'yi', 'yo', 'zh-Hans', 'zh-Hant', 'zu'] |
|
) |
|
|
|
for d in dataset: |
|
for row in d['text']: |
|
yield row |
|
|
|
del dataset |
|
gc.collect() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
dataset = load_dataset('m-a-p/CodeFeedback-Filtered-Instruction', split='train') |
|
|
|
for row in dataset: |
|
yield row['query'] + '\n' + row['answer'] |
|
|
|
del dataset |
|
gc.collect() |
|
|
|
|
|
dataset = load_dataset('nampdn-ai/tiny-codes', split='train') |
|
|
|
for row in dataset: |
|
yield row['prompt'] + '\n' + row['response'] |
|
|
|
del dataset |
|
gc.collect() |
|
|
|
|
|
dataset = load_dataset('ajibawa-2023/Maths-College', split='train') |
|
|
|
for row in dataset: |
|
yield row['instruction'] + '\n' + row['output'] |
|
|
|
del dataset |
|
gc.collect() |
|
|
|
|
|
dataset = load_dataset('microsoft/orca-math-word-problems-200k', split='train') |
|
|
|
for row in dataset: |
|
yield row['question'] + '\n' + row['answer'] |
|
|
|
del dataset |
|
gc.collect() |
|
|
|
|
|
dataset = load_dataset('mlabonne/FineTome-100k', split='train') |
|
|
|
for row in dataset['conversations']: |
|
yield '\n'.join(n['value'] for n in row) |
|
|
|
del dataset |
|
gc.collect() |
|
|
|
|
|
dataset = load_dataset('arcee-ai/agent-data', split='train') |
|
|
|
for row in dataset['conversations']: |
|
yield '\n'.join(n['value'] for n in row) |
|
|
|
del dataset |
|
gc.collect() |
|
|
|
|
|
dataset = ( |
|
load_dataset('cognitivecomputations/SystemChat-2.0', data_files='SystemChat_filtered.jsonl', split='train'), |
|
load_dataset('cognitivecomputations/SystemChat-2.0', data_files='SystemChat_multilingual.jsonl', split='train'), |
|
) |
|
|
|
for d in dataset: |
|
for row in d['messages']: |
|
yield '\n'.join(n['content'] for n in row) |
|
|
|
del dataset |
|
gc.collect() |
|
|
|
|
|
dataset = load_dataset('badrex/llm-emoji-dataset', split='train') |
|
|
|
for row in dataset: |
|
yield f'{row["character"]}\n{row["unicode"]}\n{row["short description"]}\n{row["tags"]}\n{row["LLM description"]}' |
|
|
|
del dataset |
|
gc.collect() |