119 Commits

Author SHA1 Message Date
xming521 040b6f3af1 Fix password bounds, filtered profile scope and input hashing 2026-10-03 13:27:16 +08:00
xming521 7daa270736 Add encrypted chat storage and shared-password workflows
Integrate suffixed encrypted storage across extraction, review, training, and inference. Add shared-password web authentication with two-hour sessions, private request logging, and an isolated profile-building pipeline.

Fix encrypted dataset discovery at training entrypoints and duplicate CSV imports. Add synthetic storage, authentication, and log checks; update documentation and frontend assets.
2026-10-02 23:18:07 +08:00
Iams4kura 73c8bd0008 Merge upstream master and preserve configured dataset output 2026-09-27 19:50:41 +08:00
pre-commit-ci[bot] 8de3dc79d0 🎈 auto fixes by pre-commit hooks 2026-09-27 10:03:51 +00:00
xming521 27e7aefc85 feat: add LTP filtering logic and improve episode content validation 2026-09-27 18:03:35 +08:00
pre-commit-ci[bot] ca41978ee6 🎈 auto fixes by pre-commit hooks 2026-09-27 09:21:43 +00:00
xming 7b9f699d72 fix: avoid pathlib access in async config reader 2026-09-27 17:21:33 +08:00
pre-commit-ci[bot] ac033289c0 🎈 auto fixes by pre-commit hooks 2026-09-27 09:16:49 +00:00
xming521 3086a82934 feat: Enhance agent distillation configuration and improve memory organization
- Added default values for batch size, max tokens, and timeout in distill_profile.py.
- Refactored required configuration functions to support section-specific error messages.
- Introduced positive and optional positive integer validation functions for configuration.
- Updated resolve_llm_args to utilize new configuration validation functions.
- Modified organize_memories.py to load agent distill configuration and handle missing model gracefully.
- Improved stage 2 output file management in make_dataset_stage2.py, ensuring proper validation against manifest files.
- Added new web assets including HTML, CSS, and JS files for profile review interface.
- Set up default static directory for serving web assets in profile_review.py.
2026-09-27 17:16:37 +08:00
pre-commit-ci[bot] 86b7651f79 🎈 auto fixes by pre-commit hooks 2026-09-27 08:34:55 +00:00
xming521 ad1720d4f5 feat: Add memory organization functionality with attribute hierarchy and classification
- Implemented `organize_memories.py` to manage and organize extracted profile/event memories by dimension.
- Introduced new schemas and rules for attribute hierarchy and preference attributes in `memory_organization.py`.
- Created `profile_hierarchy.py` for generating a hierarchical structure of attributes for better browsing.
- Enhanced classification and summarization processes to support new dimensions and attributes.
2026-09-27 14:36:37 +08:00
xming521 7a90f3ef1a feat: Add the distill_profile.py file, which contains user profile processing functionality and related configuration. 2026-09-27 10:52:22 +08:00
xming521 8e337d7eea refactor: unify inference kernel and migrate main callers 2026-09-13 13:58:39 +08:00
Iams4kura 5d66d32522 fix: validate configured dataset mapping 2026-08-26 12:40:05 +08:00
Iams4kura 23e47c63bd fix: save generated data to configured dataset 2026-08-26 12:35:21 +08:00
xming521 558249d4af Add event extraction functionality and update prompts
- Introduced `distill_event.py` for processing chat records and extracting events related to user interactions.
- Implemented functions for handling event payloads, rendering event chats, and managing state during processing.
- Enhanced `chat_distill.py` with a detailed prompt for extracting surface and inferred events from chat records, focusing on relevant information and event types.
- Updated logging and progress tracking for improved user feedback during event processing.
2026-06-24 15:51:15 +08:00
xming521 08a8ba9935 Add agent distillation configuration and enhance LLM client
- Introduced `agent_distill_args` in `settings.template.jsonc` to specify LLM backend for agent distillation.
- Added `AgentDistillArgs` class in `config_models.py` to support new configuration parameters.
- Enhanced `CodexExecClient` in `llm_client.py` to manage request directories and improve command execution handling.
- Created `distill_state.py` for managing state extraction and processing logic related to agent distillation.
2026-06-23 21:43:55 +08:00
xming521 2f842fb1be Refactor state extraction logic and update prompts
- Updated `distill.py` to enhance state extraction functions, introducing required configuration validation for model parameters.
- Refactored prompt definitions in `chat_distill.py`, replacing the previous state extraction prompt with a more structured template and adding a section for current state extraction.
- Improved memory filtering logic to better handle current state payloads and ensure relevant information is retained for future conversations.
- Updated subproject commit to reflect changes in the repository state.
2026-06-19 23:02:26 +08:00
xming521 e4a568c000 Add agent data utilities and state extraction prompt
- Introduced `__init__.py` for agent data construction utilities.
- Added `distill.py` containing functions for processing chat data, managing state, and saving JSON files.
- Created `chat_distill.py` with a detailed prompt for extracting memory states from chat records, focusing on various types of information such as stable facts, preferences, experiences, goals, and current states.
2026-06-17 23:03:41 +08:00
xming521 893a5c5e3b Update .gitignore, enhance LLM client with sandbox option, and add group ID assignment in dataset processing
- Modified .gitignore to include all agent files in the dataset directory.
- Added a `sandbox` parameter to the `build_llm_client` function for improved client configuration.
- Introduced helper functions to generate chat IDs and assign group IDs to items in dataset processing, enhancing data organization.
2026-06-17 23:02:35 +08:00
xming521 0e2d15f2cd Update .gitignore, enhance DataProcessor with partner remarks and chat_talker, and refactor load_file method
- Introduced `chat_talker` and `partner_remarks` attributes in DataProcessor to improve chat context handling.
- Refactored `load_file` method to streamline user data loading and relation management.
2026-06-13 16:14:01 +08:00
xming521 446df58a6c refactor(infer): streamline online model scoring and error handling
- Replaced the previous batch processing logic with a more robust implementation that utilizes guided decoding for improved result parsing.
- Enhanced error logging for failed parsing attempts, providing clearer warnings for issues encountered during inference.
- Updated the score mapping to utilize the new parsed results structure, ensuring accurate score assignment to QA pairs.
2026-01-04 18:14:57 +08:00
xming521 fca6ca1c55 feat(data): enhance conversation message processing in QA generation
- Added logic to handle the "<begin_chat>" marker in user messages, allowing for improved context in conversation flows.
- Updated the message processing to include the assistant's response when the user initiates a chat, ensuring more coherent QA pairs.
- Refactored the handling of conversation messages to maintain clarity and structure in the generated QA data.
2026-01-04 15:47:14 +08:00
xming521 bbe08f0c77 feat(data): enhance chat member relationship handling in QA generation
- Updated the `qa_generator.py` to include a new mechanism for managing chat member relationships, allowing the addition of contextual information about the relationship between users in conversations.
- Refactored the CSV loading function to support loading user relationship data from a `users.json` file, improving the context provided during QA generation.
- Added a new configuration option `add_relation` to the dataset settings, enabling users to toggle this feature.
- Updated the `.gitignore` to exclude additional data directories and cache files for better repository hygiene.
- Bumped version to 0.3.03 in `pyproject.toml` to reflect these changes.
2025-11-01 17:11:26 +08:00
xming521 a887d122af feat(data): include new sticker types in skip list
Expands the list of message types to be skipped or ignored by the application.
This ensures proper handling for user-uploaded GIF stickers and a new sticker
type identified as 'sticker2', preventing potential processing errors.
2025-08-28 22:12:59 +08:00
xming521 a0829d2098 feat(cleaning): add batch processing for online LLM
Introduce a ThreadPoolExecutor in the OnlineLLM class to enable
concurrent API calls, significantly boosting throughput for LLM operations.
Refactor the OlineLLMCleaningStrategy to leverage this new batching
capability, allowing multiple data points to be processed in parallel.

Increase the default `clean_batch_size` in settings and enhance
`n_process`/`batch_size` for PII detection to optimize for the new
concurrency. Simplify prompt management by removing a dedicated prompt
for online LLM cleaning. Add context manager support to OnlineLLM for
reliable resource cleanup. Ensure LLM chat responses explicitly request
JSON format.
2025-08-28 21:30:05 +08:00
xming521 e90f05c12a refactor(data): improve data cleaning robustness
Allow `vllm_infer` to return `None` for failed JSON parsing results,
clarifying the sequence index for such failures. This enables
`LLMCleaningStrategy` to robustly align parsed LLM scores with original data,
correctly handling examples where JSON parsing failed by assigning a default
score of 0.

Adds an option to disable data cleaning during training setup.
2025-08-17 14:30:17 +08:00
xming521 41167f6d29 fix(dataset): fix #192 standardize dataset naming and cleaning workflow
Refactors dataset management to consistently append '-vl' for vision-language
datasets and dynamically name cleaned datasets (e.g., 'dataset-cleaned').

Enforces vLLM as a strict dependency for LLM-based data cleaning, exiting if
unavailable. Integrates 'enable_thinking' option for LLM cleaning and enables
cleaning by default in relevant test configurations.

Adds torchvision dependency for vision models and streamlines the cleaning call
in training to centralize decision-making.
2025-08-16 22:51:29 +08:00
xming521 cc34bea317 fix(data): classify gif as animated stickers
Ensures that files with a .gif extension are correctly identified and
categorized as animated expressions or stickers based on the platform.
This improves the accuracy of media type classification during data
processing.
2025-08-15 15:31:45 +08:00
xming521 a3f39495de feat(core): enable configurable thinking and cleaning
Introduces a new 'enable_thinking' configuration for LLM interactions.
This allows dynamic control of thinking behavior in both offline inference
and the data cleaning process. When thinking is enabled for cleaning,
the maximum number of new tokens is increased to accommodate longer
reasoning outputs.

Also reduces the repetition penalty in the cleaning strategy for
improved response diversity and skips data entries containing images
during the LLM cleaning process to avoid irrelevant processing.
2025-08-11 15:34:27 +08:00
xming521 6b134ea703 feat(dataset): handle image data in LLM cleaning
Updates pre-commit hooks.

Previously, the cleaning pipeline was entirely disabled for datasets

containing image messages.

Image conversations now receive a default score, bypassing text-focused

LLM cleaning. This enables partial cleaning for mixed datasets and

prevents pipeline failures.
2025-08-11 11:03:14 +08:00
xming521 533b0fa678 refactor(data): converts QA item ID to string
Ensures the ID field for generated QA items is always a string. This provides type consistency for downstream consumers.
2025-07-29 11:28:23 +08:00
xming521 09897a8daf fix(dataset): Data processing results have no images. 2025-07-16 15:18:56 +08:00
xming521 785ad1472a remove wechat 2025-07-16 11:21:11 +08:00
xming521 2a7cb5f30d refactor(data): simplify datetime format
Removes the year from the datetime string included in the system prompt. This makes the prompt more concise.
2025-07-14 17:31:54 +08:00
xming521 7ce7fcd47a fix(dataset): fix blocked words filter
Adds a blocked words filter to the dataset creation process.
This prevents undesirable words from appearing in the generated
datasets, enhancing data quality and safety.
A test case is added to verify the filter is working correctly.

Also, skips "text" type in qa_generator to avoid duplicated filter.
2025-07-14 13:38:19 +08:00
xming521 49d62b3fda performance(PII): add batch PII detection
Implements batch processing for PII detection to improve
performance. Also, fixes a bug in the PII detection logic
and updates the installation instructions in the README.
2025-07-14 12:55:01 +08:00
xming521 3e7892fc76 feat(infer): add retry mechanism to API calls
Adds retry logic for OpenAI and image description API calls
to improve resilience against transient errors and rate
limiting. Implements exponential backoff with configurable
parameters.
2025-07-10 19:29:23 +08:00
xming521 a24442b78d feat(PII): enhance PII detection for Chinese
Improves PII detection for Chinese language data by:

- Adding a Chinese-specific PII detector that inherits from
  the base PII detector.
- Incorporating custom recognizers for common Chinese PII
  patterns (e.g., phone numbers, ID cards).
- Filtering out irrelevant country-specific entities when
  processing Chinese text.
- Adding unicode escape id recognizer.

These changes ensure more accurate and comprehensive
identification of sensitive information in Chinese datasets.
2025-07-10 12:10:09 +08:00
xming521 5f34b4561e feat(dataset): adds option to include time
Adds a configuration option to include the current
datetime in the system prompt of the generated dataset.
This allows models to be aware of the temporal context
of the conversations.
2025-07-09 23:15:51 +08:00
xming521 e96853d0fb refactor(dataset): removes newline characters from messages
This commit addresses an issue where newline characters
within text messages were causing problems in downstream
processing. It removes these characters to ensure that
the messages are processed correctly.
2025-07-08 18:31:30 +08:00
xming521 5b47d9b9ab refactor: unifies combined content separator
Consolidates the separator for combined content to a newline character, removing language-specific branching.
This simplifies the logic and ensures consistency across different languages.
2025-07-08 16:52:47 +08:00
xming521 f0476b05e7 feat(tg): add sticker parameter to include_type
Adds support for processing stickers in Telegram chat data.

- Includes 'sticker' as a valid DataModality.
- Allows the option to include sticker emojis as message content.
2025-07-06 10:38:28 +08:00
xming521 d113218e42 更新README文档;修改清理策略中的评分解析逻辑。 2025-07-04 20:51:38 +08:00
xming521 38113a2524 翻译注释日志为英文 2025-07-01 20:00:34 +08:00
xming521 256a601d9f 在qa_generator.py中设置VLLM_WORKER_MULTIPROC_METHOD环境变量为"spawn";删除train_pt.py文件。 2025-06-30 20:42:39 +08:00
xming521 16ec7178d7 更新README文档,翻译部分内容为英文并调整格式; 翻译注释 和 日志。 2025-06-30 20:02:25 +08:00
xming521 2f9cc52955 更新pyproject.toml以添加pip依赖;优化README文档,增强数据预处理说明;调整日志系统配置,支持从配置文件读取日志等级;重构PII检测器,简化代码并添加自定义识别器;更新数据处理逻辑以支持多语言和隐私过滤。 2025-06-27 23:05:45 +08:00
xming521 6df8c5cf2f 使用presidio进行隐私过滤 ; 添加语言支持配置;优化日志系统,hook标准logging到loguru。 2025-06-26 22:54:45 +08:00
xming521 b265edf2fc 更新依赖项,将commentjson替换为pyjson5;优化README文档,修正项目文档链接;添加聊天平台适配表格以支持不同平台的消息类型。 2025-06-26 15:10:09 +08:00