From b265edf2fcdfdca44e180ab1a0ed73b1a3bd2017 Mon Sep 17 00:00:00 2001 From: xming521 <1223398803@qq.com> Date: Thu, 26 Jun 2025 15:10:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BE=9D=E8=B5=96=E9=A1=B9?= =?UTF-8?q?=EF=BC=8C=E5=B0=86commentjson=E6=9B=BF=E6=8D=A2=E4=B8=BApyjson5?= =?UTF-8?q?=EF=BC=9B=E4=BC=98=E5=8C=96README=E6=96=87=E6=A1=A3=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E9=A1=B9=E7=9B=AE=E6=96=87=E6=A1=A3=E9=93=BE?= =?UTF-8?q?=E6=8E=A5=EF=BC=9B=E6=B7=BB=E5=8A=A0=E8=81=8A=E5=A4=A9=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0=E9=80=82=E9=85=8D=E8=A1=A8=E6=A0=BC=E4=BB=A5=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E4=B8=8D=E5=90=8C=E5=B9=B3=E5=8F=B0=E7=9A=84=E6=B6=88?= =?UTF-8?q?=E6=81=AF=E7=B1=BB=E5=9E=8B=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 11 ++++++++++- README_zh.md | 9 ++++++++- pyproject.toml | 4 +++- weclone/cli.py | 4 ++-- weclone/data/models.py | 18 +++++++++--------- weclone/utils/config.py | 4 ++-- 6 files changed, 34 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index eb691d1..99b3a21 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ 简体中文| English| Project Homepage | - Documentation + Documentation

> [!IMPORTANT] @@ -37,6 +37,15 @@ > [!IMPORTANT] > ### WeClone is currently not partnered with any platform and has not issued any cryptocurrency. The only official website is: [weclone.love](https://www.weclone.love). Beware of imitations. +### Chat Platform Support + +| Platform | Text | Images | Voice | Video | Animated Emojis | Links (Sharing) | Quote | Forward | Location | Files | +|----------|------|--------|-------|-------|-----------------|-----------------|-------|---------|----------|-------| +| WeChat | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | +| Telegram | ✅ | ✅ | ❌ | ❌ | ⚠️Convert to Emoji | ❌ | ❌ | ✅ | ✅ | ❌ | + + + > [!IMPORTANT] > - WeClone is still in rapid iteration phase, current performance does not represent final results. > - LLM fine-tuning effectiveness largely depends on model size, quantity and quality of chat data. Theoretically, larger models with more data yield better results. diff --git a/README_zh.md b/README_zh.md index a16e8e2..6d2a875 100644 --- a/README_zh.md +++ b/README_zh.md @@ -21,7 +21,7 @@

项目主页 | - 项目文档 | + 项目文档 Windows部署指南 Linux部署指南【保姆级】

@@ -39,6 +39,13 @@ > [!IMPORTANT] > ### WeClone 目前未与任何平台合作,未发行任何数字货币。唯一官方网站:[weclone.love](https://www.weclone.love),谨防仿冒。 +### 聊天平台适配 + +| 平台 | 文字 | 图片 | 语音 | 视频 | 动画表情 | 链接(分享) | 引用 | 转发 | 位置 | 文件 | +|------|------|------|------|------|----------|-----------|------|------|------|------| +| 微信 | ✅ | ✅ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌ | +| Telegram | ✅ | ✅ | ❌ | ❌ | ⚠️转为Emjoy | ❌ | ❌ | ✅ | ✅ | ❌ | + > [!IMPORTANT] > - WeClone仍在快速迭代期,当前效果不代表最终效果。 > - 微调LLM效果很大程度取决于模型大小、聊天数据的数量和质量,理论上模型越大,数据越多,效果越好。 diff --git a/pyproject.toml b/pyproject.toml index bd19c50..5ca7191 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ requires-python = ">=3.10,<3.11" dependencies = [ "pandas", - "commentjson", + "pyjson5", "omegaconf", "click", "tqdm", @@ -40,6 +40,8 @@ main = [ "transformers==4.52.1", "accelerate==1.7.0", "triton==3.3.0; platform_system == 'Linux'", + "presidio_analyzer[transformers]", + "presidio_anonymizer", ] sparktts = [ "einops>=0.8.1", diff --git a/weclone/cli.py b/weclone/cli.py index 3940193..df34992 100644 --- a/weclone/cli.py +++ b/weclone/cli.py @@ -5,7 +5,7 @@ from pathlib import Path from typing import cast import click -import commentjson +import pyjson5 from weclone.utils.config import load_config from weclone.utils.config_models import CliArgs @@ -168,7 +168,7 @@ def _check_versions(): if SETTINGS_PATH.exists(): try: with open(SETTINGS_PATH, "r", encoding="utf-8") as f: - settings_data = commentjson.load(f) + settings_data = pyjson5.load(f) settings_version = settings_data.get("version") except Exception as e: logger.error(f"错误:无法读取或解析 {SETTINGS_PATH}: {e}") diff --git a/weclone/data/models.py b/weclone/data/models.py index 2cf98a5..8e87233 100644 --- a/weclone/data/models.py +++ b/weclone/data/models.py @@ -12,16 +12,16 @@ from weclone.utils.i18n import MultiLangList @dataclass class ChatMessage: id: int # 顺序id - MsgSvrID: int - type_name: str + MsgSvrID: str # 消息平台原始id + type_name: str # 消息类型 参考cut_type_data和skip_type_data is_sender: int # 0: 对方 1: 自己 - talker: str - msg: str - src: str - CreateTime: Timestamp - room_name: Optional[str] = None - is_forward: bool = False - modality: Optional[DataModality] = None + talker: str # 消息发送者 + msg: str # 消息内容 + src: str # 媒体文件路径、额外信息字段 + CreateTime: Timestamp # 消息发送时间 + room_name: Optional[str] = None # 聊天室名称 + is_forward: bool = False # 是否是转发消息 + modality: Optional[DataModality] = None # 消息模态 set in qa_generator.py @dataclass diff --git a/weclone/utils/config.py b/weclone/utils/config.py index fc5f8a0..10b9a4e 100644 --- a/weclone/utils/config.py +++ b/weclone/utils/config.py @@ -2,7 +2,7 @@ import os import sys from typing import Any, Dict, cast -import commentjson +import pyjson5 from omegaconf import OmegaConf from pydantic import BaseModel @@ -23,7 +23,7 @@ def load_base_config() -> WcConfig: try: with open(config_path, "r", encoding="utf-8") as f: - s_config_dict: Dict[str, Any] = commentjson.load(f) + s_config_dict: Dict[str, Any] = pyjson5.load(f) except FileNotFoundError: logger.error(f"Configuration file not found: {config_path}") sys.exit(1)