Commit Graph

428 Commits

Author SHA1 Message Date
Octopus e6325fd8b7 refactor: derive API server URL from client.base_url for error message
Address Sourcery review feedback - use client.base_url instead of
hardcoding http://127.0.0.1:8005 so the error message stays in sync
if the base URL configuration changes.
2026-04-24 13:02:10 +08:00
octo-patch d8d2c673f4 fix: check API server availability before running test-model (fixes #115)
Add _check_api_server() that probes GET /v1/models before the test loop
starts. When the server is not running, the user now gets a clear error
message with the exact command to start it instead of a cryptic
connection-refused traceback.

Co-Authored-By: Octopus <liyuan851277048@icloud.com>
2026-04-24 12:19:52 +08:00
小铭 6f359b507a Update README with support details and disclaimer
Added support information and updated project disclaimer.
2026-04-14 10:25:17 +08:00
小铭 3a2c09822c Update README with DartNode branding and disclaimer
Added DartNode branding image and disclaimer to README.
2026-04-10 21:14:20 +08:00
小铭 3d618a76ff Add support for personal WeChat in deployment section 2026-03-25 16:59:01 +08:00
小铭 34754b0be4 Add WeChat support information to README 2026-03-25 16:56:49 +08:00
小铭 1779b5d8af Update acknowledgment section in README_zh.md 2026-01-20 10:54:13 +08:00
小铭 0379096591 Merge pull request #209 from xming521/dev
v0.3.03
v0.3.03
2026-01-04 22:36:06 +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 27d877aad3 refactor(infer): improve guided decoding error handling in online inference
- Replaced the previous parsing logic with enhanced error handling for JSON extraction from LLM outputs.
- Introduced detailed logging for failed requests and unexpected result types, improving traceability of issues during inference.
- Updated the import statement to reflect the new utility function for JSON extraction.
2026-01-04 18:07:37 +08:00
xming521 a02b23bb2f chore: update Python version in README files
- Changed the recommended Python version from 3.10 to 3.12 in both `README.md` and `README_zh.md`.
2026-01-04 16:24:19 +08:00
xming521 1107500c41 chore: update dependencies and configuration
- Updated Python version requirement in `pyproject.toml` to 3.12.
- Adjusted dependency specifications for `llamafactory`, `torch`, `torchvision`, and `torchaudio` to include version constraints.
2026-01-04 16:15:15 +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
小铭 8ee9d05892 Merge branch 'master' into dev 2025-11-01 17:21:17 +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
小铭 9eab753787 Update README.md 2025-10-11 17:42:26 +08:00
小铭 30b9ca059e Add online fine-tuning section to README
Added section for online fine-tuning with Lab4AI.
2025-10-11 17:41:20 +08:00
xming521 5669838a91 refactor(infer): improve LLM result parsing error logs
Enhance error messages when JSON parsing of LLM outputs fails in
offline inference. The system now dynamically extracts relevant
text snippets based on the response object type (e.g., RequestOutput,
ChatCompletion), making error logs more informative.

Additionally, suppress verbose debug/info logs from the OpenAI client
and httpx to reduce console noise during online inference.

Update the 'WC-exp' submodule and add 'models_final/*' to .gitignore
for repository hygiene.
2025-09-03 13:31:06 +08:00
xming521 c1c7530630 feat(infer): add guided decoding for online and offline models
Introduces a unified utility to parse and validate JSON-structured outputs
from both vLLM and OpenAI API inference results using Pydantic models.
This enables guided decoding for the OnlineLLM.chat method.
The existing guided decoding logic in vllm_infer is refactored to use
this new shared utility, improving consistency and error handling across
inference modes.
2025-08-29 16:03:57 +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 ac5afb83f9 Merge remote-tracking branch 'origin/master' into dev 2025-08-28 21:31:16 +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
小铭 7a5bcb491e Merge pull request #198 from MapleWithered/patch-1
fix: fix triton source from default cuda129 to 126
2025-08-27 21:31:46 +08:00
枫亚 c384987b8a fix: fix triton source from cuda129 to 126 2025-08-27 19:42:48 +08:00
小铭 a96996fcbf Merge pull request #196 from xming521/dev
v0.3.02
v0.3.02
2025-08-17 15:18:53 +08:00
xming521 5dcaad0e10 perf(infer): clear cuda cache after inference
Adds a call to empty the CUDA cache immediately after the LLM object is deleted, ensuring prompt release of GPU memory. This helps prevent out-of-memory issues and improves resource utilization for subsequent operations.
2025-08-17 15:18:37 +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 1e8de85376 chore(config): Updates the project and configuration versions to 0.3.02.
This release introduces the ability to control the offline cleaning process through the `enable_thinking` configuration parameter.
2025-08-15 22:55:41 +08:00
xming521 8309c498d3 Merge branch 'dev' of https://github.com/xming521/WeClone into dev 2025-08-15 16:53:06 +08:00
xming521 cdef4213cf chore(deps): update core dependencies
Upgrades openai, vllm, torch, transformers, and triton to their
latest versions. This ensures compatibility, incorporates recent bug
fixes, and leverages performance improvements across the project.
2025-08-15 16:46:32 +08:00
xming521 c89dc8100c test(tests): update qwen3 test model to 0.6B
Updates the Qwen3 model in test configurations from 4B to the smaller 0.6B version.
This change helps improve test performance and reduce resource requirements.
2025-08-15 15:34:46 +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 7e9886c020 perf(config): reduce default lora rank
Reduces the default LoRA rank in training configuration templates from 16 to 8.
This change aims to optimize resource usage and potentially accelerate training.
2025-08-11 11:23:37 +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 a05bb7e856 Merge remote-tracking branch 'origin/master' into dev 2025-08-10 10:30:49 +08:00
xming521 a0f6d0e9b0 chore(tests): include PII test data file
Ensures a specific PII test data file is tracked by Git, enabling its use in related tests.
2025-08-10 10:29:16 +08:00
xming521 ff0015a2ba performance : some improve 2025-08-09 21:35:43 +08:00
小铭 f67d8d2145 Merge pull request #193 from xming521/pre-commit-ci-update-config
🎈 pre-commit autoupdate hooks
2025-08-05 16:58:49 +08:00
pre-commit-ci[bot] 8fea9c1f9b 🎈 pre-commit autoupdate hooks
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.12.2 → v0.12.7](https://github.com/astral-sh/ruff-pre-commit/compare/v0.12.2...v0.12.7)
2025-08-04 21:27:18 +00: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
小铭 4c20fc900c Update .gitkeep 2025-07-21 14:34:32 +08:00
小铭 f22556c74c Update README_zh.md 2025-07-19 16:37:43 +08:00
小铭 758f3a04d4 Update README.md 2025-07-19 16:35:09 +08:00
xming521 5a560adafb perf(train): optimize default training configs
Increases LoRA rank from 4 to 16 in example and default configurations.
This aims to improve model fine-tuning effectiveness.

Adjusts per-device batch size and gradient accumulation steps. This
maintains the same effective batch size while potentially reducing
memory usage.

Standardizes LoRA dropout to 0.25 across configurations.

Updates READMEs to clarify model performance expectations.
2025-07-17 22:21:54 +08:00
小铭 d65784f1dd Merge pull request #189 from xming521/dev
Dev
v0.3.01
2025-07-17 15:19:07 +08:00
xming521 98f506e14a Remove WC-exp submodule entry from remote repository 2025-07-17 15:12:26 +08:00
xming521 77752b6d36 docs: remove redundant multi-gpu training section
The multi-GPU training instructions were duplicated in the README. This change removes the redundant section to simplify the documentation.
2025-07-16 17:02:56 +08:00
xming521 3bb4f04206 chore: remove WC-exp submodule
Removes the WC-exp Git submodule. This dependency is no longer required for the
project, which simplifies the repository's structure and reduces complexity.
2025-07-16 15:47:21 +08:00