Skip to content

Commit 98503cc

Browse files
committed
fix sft format
1 parent f54bd30 commit 98503cc

File tree

5 files changed

+13
-436
lines changed

5 files changed

+13
-436
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ This code uses the `std::cout` object to print the string "Hello, world!" to the
295295
| Equation solver | Solve(equation) |
296296
| Text-to-image | Text2Image(description) |
297297

298-
启用"Inner Thoughts"和对应插件后,可以通过以下代码获取插件调用命令
298+
以下是一个MOSS使用搜索引擎插件的示例
299299

300300
```python
301301
>>> from transformers import AutoTokenizer, AutoModelForCausalLM, StoppingCriteriaList
@@ -316,7 +316,7 @@ This code uses the `std::cout` object to print the string "Hello, world!" to the
316316
<|Commands|>: Search("黑暗荣耀 主演")
317317
```
318318

319-
本轮调用模型后我们获取了调用插件命令,在执行插件后将插件返回结果拼接到"Results"中即可再次调用模型得到回复。其中插件返回结果应按照如下格式:
319+
本轮调用模型后我们获取了调用插件命令`Search("黑暗荣耀 主演")`,在执行插件后将插件返回结果拼接到"Results"中即可再次调用模型得到回复。其中插件返回结果应按照如下格式:
320320

321321
```
322322
Search("黑暗荣耀 主演") =>
@@ -353,7 +353,7 @@ Search("黑暗荣耀 主演") =>
353353
<|MOSS|>: 《黑暗荣耀》的主演包括宋慧乔、李到晛、林智妍、郑星一等人。<sup><|1|></sup><eom>
354354
```
355355

356-
其他插件格式请参考[conversation_with_plugins](https://github.com/OpenLMLab/MOSS/tree/main/SFT_data/conversations/conversation_with_plugins).
356+
其他插件格式请参考[conversation_with_plugins](https://github.com/OpenLMLab/MOSS/tree/main/SFT_data/conversations/conversation_with_plugins). 搜索引擎插件可参照我们开源的[MOSS WebSearchTool](https://github.com/OpenLMLab/MOSS_WebSearchTool).
357357

358358
#### 命令行Demo
359359

moss_cli_demo.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,7 @@ def main():
4848
- It apologizes and accepts the user's suggestion if the user corrects the incorrect answer generated by MOSS.
4949
Capabilities and tools that MOSS can possess.
5050
"""
51-
web_search_switch = '- Web search: disabled.\n'
52-
calculator_switch = '- Calculator: disabled.\n'
53-
equation_solver_switch = '- Equation solver: disabled.\n'
54-
text_to_image_switch = '- Text-to-image: disabled.\n'
55-
image_edition_switch = '- Image edition: disabled.\n'
56-
text_to_speech_switch = '- Text-to-speech: disabled.\n'
5751

58-
meta_instruction = meta_instruction + web_search_switch + calculator_switch + equation_solver_switch + text_to_image_switch + image_edition_switch + text_to_speech_switch
5952
prompt = meta_instruction
6053
print("欢迎使用 MOSS 人工智能助手!输入内容即可进行对话。输入 clear 以清空对话历史,输入 stop 以终止对话。")
6154
while True:

moss_gui_demo.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,6 @@
4646
- It apologizes and accepts the user's suggestion if the user corrects the incorrect answer generated by MOSS.
4747
Capabilities and tools that MOSS can possess.
4848
"""
49-
web_search_switch = '- Web search: disabled.\n'
50-
calculator_switch = '- Calculator: disabled.\n'
51-
equation_solver_switch = '- Equation solver: disabled.\n'
52-
text_to_image_switch = '- Text-to-image: disabled.\n'
53-
image_edition_switch = '- Image edition: disabled.\n'
54-
text_to_speech_switch = '- Text-to-speech: disabled.\n'
55-
56-
meta_instruction = meta_instruction + web_search_switch + calculator_switch + \
57-
equation_solver_switch + text_to_image_switch + \
58-
image_edition_switch + text_to_speech_switch
5949

6050

6151
"""Override Chatbot.postprocess"""

0 commit comments

Comments
 (0)