* Add code for data filtering llm judge * Ignore log file created on root (mainly for synthetic_data_generation.log) * Fix metadata API compatibility issues by commenting out metadata tags in LLM API calls - Commented out metadata.tags parameters in all LLM API calls across the codebase - This fixes compatibility issues with custom LLM providers that don't support metadata - Affects shades generation, topics generation, wiki generation, bio QA, and question generation - Preserves the original code structure for future re-enabling if needed * feat: add data filtering pipeline with Ollama integration - Add MergedDataJudge class for intelligent data filtering using Ollama Gemma - Integrate automatic Ollama CLI installation into project setup process - Add DATA_FILTERING step to training pipeline with concurrent processing - Include testing for MergedDataJudge in its local main() function - Add Ollama dependency to pyproject.toml * feat: add automatic Ollama model cleanup after data filtering * Add logging for outputting data filtering parameters * fix: adjust error handling for MergedDataJudge: - Keep original merged.json unchanged when any error occurs - Exit filtering process immediately on errors instead of continuing with defaults - Ensure training pipeline continues safely even if data filtering fails * Add frontend for data filtering pipeline * resolve data filtering quality_level error by commenting out problematic fields, change TrainProcessService back to original class definition * fix: quote unquoted shade icons to prevent JSON parsing errors * Fixed wiki_res.json missing due to no database connection at wiki/base.py module import * Added scoring reasoning as part of the merged data * fix: filter ANSI escape sequences from Ollama logs in data filtering step * fix: Add data filtering steps to cloud training to resolve KeyError - Added 'Data Filtering' step to cloud training progress holder - Added data filtering step execution in cloud training service - Added data filtering parameters to cloud training routes - Updated frontend to send data filtering parameters - Fixed missing except clause in cloud training service This resolves the KeyError: 'data_filtering' when switching from cloud to local training. |
||
|---|---|---|
| .. | ||
| data_pipeline | ||
| dpo | ||
| gguf-py | ||
| mlx_training | ||
| __init__.py | ||
| convert_hf_to_gguf.py | ||
| convert_model_to_gguf.sh | ||
| convert_to_single_line.py | ||
| data.py | ||
| download_model.sh | ||
| l2_generator.py | ||
| memory_manager.py | ||
| merge_lora_weights.py | ||
| merge_weights_for_user.sh | ||
| merged_data_judge.py | ||
| note_templates.py | ||
| README.md | ||
| train.py | ||
| train_for_user.sh | ||
| training_prompt.py | ||
| utils.py | ||
Long Chain-of-Thought (CoT) Feature Implementation
Overview
This implementation adds Long Chain-of-Thought (CoT) capability to the data synthesis pipeline when using DeepSeek R1 as the base model. The feature enables multi-step reasoning for enhanced context-aware responses.
Feature Description
-
Long CoT Mode: When enabled, the system generates synthetic data with extended reasoning chains
-
DeepSeek R1 Integration: Exclusive use of DeepSeek-R1 model for CoT data generation
-
Enhanced Training: Produces models with improved long-context reasoning capabilities
Implementation Details
Configuration Options
-
Backend Configuration:
-
Set
is_cot=Trueintrainprocess_service.pyinitialization -
Configure via
train_for_user.shwith--is_cot True/False -
Environment variables in
lpm_kernel/L2/.env:
DEEPSEEK_MODEL_NAME=deepseek-* DEEPSEEK_API_KEY=your_api_key DEEPSEEK_BASE_URL=your_base_url -
Data Synthesis Pipeline
-
Supported Data Types:
-
SelfQA data
-
Preference data
-
Diversity data
-
-
Prompt Structure:
<think>reasoning_content</think>
<answer>final_content</answer>
-
Model Whitelisting:
- Only DeepSeek-R1 is allowed for CoT data generation
Code Changes
-
Modified Files:
-
selfqa.py:-
Added
is_cotinitialization option -
Updated prompt templates
-
Modified response handling
-
-
preference_QA_generate.py:-
Added CoT support
-
Enhanced question extraction
-
-
diversity_data_generator.py:-
Added CoT templates
-
Updated generation logic
-
-
-
New Functions:
-
Unified
get_remote_response()function -
Enhanced logging with tqdm integration
-