From d113218e429a9ffa1784ceea54bfa4eec5b58b2b Mon Sep 17 00:00:00 2001 From: xming521 <1223398803@qq.com> Date: Fri, 4 Jul 2025 20:51:38 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0README=E6=96=87=E6=A1=A3?= =?UTF-8?q?=EF=BC=9B=E4=BF=AE=E6=94=B9=E6=B8=85=E7=90=86=E7=AD=96=E7=95=A5?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E8=AF=84=E5=88=86=E8=A7=A3=E6=9E=90=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 10 +++++++--- README_zh.md | 1 + weclone/core/inference/online_infer.py | 1 - weclone/data/clean/strategies.py | 6 +++--- weclone/data/models.py | 4 ++++ 5 files changed, 15 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index f80fb6c..f5f656f 100644 --- a/README.md +++ b/README.md @@ -55,12 +55,13 @@ ### Recent Updates [25/06/05] Support for image modal data fine-tuning +[25/07/10] Data source added Telegram ### Hardware Requirements The project uses Qwen2.5-VL-7B-Instruct model by default with LoRA method for SFT stage fine-tuning. You can also use other models and methods supported by [LLaMA Factory](https://github.com/hiyouga/LLaMA-Factory/tree/main#supported-models). -Estimated VRAM requirements (text-only large model memory usage as follows, vision models increase based on image quantity and size): +Estimated VRAM requirements: | Method | Precision | 7B | 14B | 30B | 70B | `x`B | | ------------------------------- | --------- | ----- | ----- | ----- | ------ | ------- | | Full (`bf16` or `fp16`) | 32 | 120GB | 240GB | 600GB | 1200GB | `18x`GB | @@ -162,9 +163,12 @@ weclone-cli server weclone-cli test-model ``` -## 🖼️ Fine-tuning Results +## 🖼️ Results Showcase > [!TIP] -> **英文例子怎么发 More cases can be found on [XiaoHongShu](https://www.xiaohongshu.com/user/profile/628109730000000021029de4)** +> **We're looking for interesting examples of native English speakers chatting with WeClone! Feel free to share them with us on Twitter. + +??? + More cases can be found on [XiaoHongShu](https://www.xiaohongshu.com/user/profile/628109730000000021029de4)** Using the Qwen2.5VL 32B model with approximately 10,000 processed effective data samples, the loss was reduced to around 3.6:
diff --git a/README_zh.md b/README_zh.md index 3b2147d..5bb14e6 100644 --- a/README_zh.md +++ b/README_zh.md @@ -55,6 +55,7 @@ ### 近期更新 [25/06/05]支持图片模态数据微调 +[25/07/10]数据源增加Telegram ### 硬件要求 diff --git a/weclone/core/inference/online_infer.py b/weclone/core/inference/online_infer.py index 9880641..d902777 100644 --- a/weclone/core/inference/online_infer.py +++ b/weclone/core/inference/online_infer.py @@ -29,7 +29,6 @@ class OnlineLLM: temperature=temperature, max_tokens=max_tokens, top_p=top_p, - # enable_thinking=enable_thinking Adapt Qwen3 dynamic reasoning activation ) return response diff --git a/weclone/data/clean/strategies.py b/weclone/data/clean/strategies.py index c0f1c60..06a6af5 100644 --- a/weclone/data/clean/strategies.py +++ b/weclone/data/clean/strategies.py @@ -10,7 +10,7 @@ from langchain_core.prompts import PromptTemplate from tqdm import tqdm from weclone.core.inference.online_infer import OnlineLLM -from weclone.data.models import QaPair, QaPairScore +from weclone.data.models import QaPair, QaPairScore, QaPairScoreWithId from weclone.prompts.clean_data import CLEAN_PROMPT, ONLINE_LLM_CLEAN_PROMPT from weclone.utils.config_models import WCMakeDatasetConfig from weclone.utils.log import logger @@ -175,7 +175,7 @@ class OlineLLMCleaningStrategy(CleaningStrategy): # Fill template prompt_text = prompt_template.invoke({"qa_list": qa_list_json}).text try: - response = client.chat(prompt_text) + response = client.chat(prompt_text, temperature=0) result_text = response.choices[0].message.content # print("Model response:",result_text) # If there is , keep only the content after @@ -191,7 +191,7 @@ class OlineLLMCleaningStrategy(CleaningStrategy): continue for item in score_list: - parsed_scores.append(QaPairScore(**item)) + parsed_scores.append(QaPairScoreWithId(**item)) except Exception as e: ids_in_batch = [qa["id"] for qa in qa_list] logger.error( diff --git a/weclone/data/models.py b/weclone/data/models.py index 2361c24..f33feeb 100644 --- a/weclone/data/models.py +++ b/weclone/data/models.py @@ -50,6 +50,10 @@ class QaPairScore(BaseModel): score: int = Field(ge=1, le=5) +class QaPairScoreWithId(QaPairScore): + id: int + + cut_type_data = { "zh_CN": [ "Cut",