FastDatasets is a dataset generation tool for fine-tuning large language models, and its core purpose is to convert documents into training data that can be used directly for supervised fine-tuning (SFT).
Main capabilities: intelligent segmentation of documents in multiple formats such as PDF, Word, Markdown, and plain text; automatic generation of related questions based on document content, and calling an LLM to generate high-quality answers; support for asynchronous processing to handle large-scale documents; support for knowledge distillation to extract knowledge from large models and build training datasets; support for instruction augmentation to automatically generate instruction variants; use of an LLM to optimize and improve data quality; support for distillation from datasets in multiple formats; export to formats such as Alpaca and ShareGPT.
Usage: the project provides a Web interface. Run python web_app.py to start it, and the default address is http://localhost:7860。界面支持拖拽或点击上传多个文件批量处理,可配置文本分块的最小/最大长度、输出格式、LLM API Key, Base URL, model name, concurrency count, as well as advanced options such as enabling chain-of-thought (CoT) and setting the number of questions per chunk. The processing has real-time progress and log monitoring, and the dataset can be downloaded after completion. For dependency packages, see requirements.txt. Before use, the LLM API information in the .env file must be configured correctly.
Output files: after document processing, chunks.json, questions.json, answers.json, optimized.json, and dataset-alpaca.json are generated in the output directory, as well as dataset-sharegpt.json generated after configuration; knowledge distillation creates a timestamped subdirectory under the output directory and generates distilled.json, distilled-alpaca.json, and distilled-sharegpt.json.
Limitations and troubleshooting: if processing is slow, increase MAX_LLM_CONCURRENCY or reduce LLM_MAX_TOKENS; if memory is insufficient, reduce the number or size of documents; if the API times out, check the network or lower concurrency. Other details are not yet provided.