1
1
<div align =" center " >
2
- <img src =" https://github.com/SmartFlowAI/TheGodOfCookery/blob/main/images /cooker.png " width =" 1092 " />
2
+ <img src =" https://github.com/SmartFlowAI/TheGodOfCookery/blob/main/assets /cooker.png " width =" 1092 " />
3
3
<br /><br />
4
4
5
5
[ 中文] ( https://github.com/SmartFlowAI/TheGodOfCookery/blob/main/README.md ) | [ English] ( https://github.com/SmartFlowAI/TheGodOfCookery/blob/main/README_EN.md )
13
13
[ ![ Static Badge] ( https://img.shields.io/badge/-gery?style=social&label=🤖%20ModelScope1代7b模型 )] ( https://www.modelscope.cn/models/zhanghuiATchina/zhangxiaobai_shishen_full/summary ) [ ![ Static Badge] ( https://img.shields.io/badge/-gery?style=social&label=🤖%20ModelScope2代7b模型 )] ( https://www.modelscope.cn/models/zhanghuiATchina/zhangxiaobai_shishen2_full/summary ) [ ![ Static Badge] ( https://img.shields.io/badge/-gery?style=social&label=🤖%20ModelScope2代1.8b模型 )] ( https://www.modelscope.cn/models/zhanghuiATchina/zhangxiaobai_shishen2_full_1_8b/summary )
14
14
15
15
</div >
16
- </ p >
17
- <div align =center ><img src =" https://github.com/zzd2001/TheGodOfCookery/blob/main/images /congratulation_cover.jpg " /></div >
16
+
17
+ <div align =center ><img src =" https://github.com/zzd2001/TheGodOfCookery/blob/main/assets /congratulation_cover.jpg " /></div >
18
18
19
19
<p align =" center " ><b style =" font-size :larger " >《食神》项目获上海人工智能实验室主办的2024浦源大模型系列挑战赛春季赛创新创意奖!!!</b ></p >
20
20
21
- ![ ] ( images /2024_PuYuan_Competition_certificate.png)
21
+ ![ ] ( assets /2024_PuYuan_Competition_certificate.png)
22
22
## 📍目录
23
23
- [ 📍目录] ( #目录 )
24
24
- [ 📖项目简介] ( #项目简介 )
56
56
57
57
项目主要依赖上海人工智能实验室开源模型internlm-chat-7b(包含1代和2代),在XiaChuFang Recipe Corpus 提供的1,520,327种中国食谱数据集上借助Xtuner进行LoRA微调,形成shishen2_full模型,并将微调后模型与向量数据库整合入langchain,实现RAG检索增强的效果,并可进行多模态(语音、文字、图片)问答对话,前端基于streamlit实现与用户的交互。
58
58
59
- ![ ] ( images /整体技术架构.png)
59
+ ![ ] ( assets /整体技术架构.png)
60
60
61
61
### 2. 应用整体流程
62
62
63
63
用户发出请求后,应用加载模型(语音模型,文生图模型,微调后的对话模型),并处理用户的文字输入或者语音输入,如果未打开RAG开关,则直接调用微调后的对话模型生成回复,对结果进行格式化输出,并调用stable diffusion模型生成图片,最后将相应结果返回用户;如果打开RAG开关,则利用langchain检索向量数据库,并将检索结果输入微调后的对话模型生成回复,对结果进行格式化输出,并调用stable diffusion模型生成图片,最后将相应结果返回用户。
64
64
65
- ![ ] ( images /处理流程.png)
65
+ ![ ] ( assets /处理流程.png)
66
66
67
67
## ✨技术报告
68
68
@@ -171,17 +171,17 @@ xtuner chat ${SAVE_PATH} [optional arguments]
171
171
172
172
Demo 访问地址:[ A100] ( https://openxlab.org.cn/apps/detail/zhanghui-china/shishen2024 ) [ A10] ( https://openxlab.org.cn/apps/detail/zhanghui-china/shishen2024_1.8b )
173
173
174
- ![ 1710422208862] ( images /1710422208862.png)
174
+ ![ 1710422208862] ( assets /1710422208862.png)
175
175
176
- ![ 1710422224731] ( images /1710422224731.png)
176
+ ![ 1710422224731] ( assets /1710422224731.png)
177
177
178
178
一阶段对话效果(纯文本对话):
179
179
180
180
Demo 样例
181
181
182
- ![ answer001] ( images /answer001.png)
182
+ ![ answer001] ( assets /answer001.png)
183
183
184
- ![ answer002] ( images /answer002.png)
184
+ ![ answer002] ( assets /answer002.png)
185
185
186
186
### 6. 模型地址
187
187
@@ -227,8 +227,13 @@ print(response)
227
227
228
228
二阶段
229
229
230
- ``` shell
230
+ ``` shell
231
231
项目目录
232
+ | ---assets # 图片目录,生成的图片临时也放在这里,今后会考虑迁移到其他目录
233
+ | | ---robot.png # 对话机器人图标
234
+ | | ---user.png # 对话用户图标
235
+ | | ---shishen.png # 项目图标 (主要贡献者 @刘光磊)
236
+ |
232
237
| ---config # 配置文件目录(主要贡献者 @房宇亮)
233
238
| | ---__init__.py # 初始化脚本
234
239
| | ---config.py # 配置脚本
@@ -237,66 +242,48 @@ print(response)
237
242
| | ---tech_report.md # 技术报告
238
243
| | ---Introduce_x.x.pdf # 项目介绍PPT
239
244
|
245
+ | ---eval # RAG模块评测目录
246
+ |
247
+ | ---food_icon # 食材图标目录
248
+ | | ---* .png # 各类食材图标
249
+ |
240
250
| ---gen_image # 文生图目录(主要贡献者 @房宇亮)
241
251
| | ---__init__.py # 初始化脚本
242
252
| | ---sd_gen_image.py # 使用Stabble Disffion的文生图模块
243
253
| | ---zhipu_ai_image.py # 使用智谱AI的文生图模块
244
254
|
245
- | ---images # 的图片目录,生成的图片临时也放在这里,今后会考虑迁移到其他目录
246
- | | ---robot.png # 对话机器人图标
247
- | | ---user.png # 对话用户图标
248
- | | ---shishen.png # 项目图标 (主要贡献者 @刘光磊)
255
+ | ---images # 暂存文生图模型生成的图片的目录
249
256
|
250
257
| ---rag # 二代RAG代码目录(主要贡献者 @乐正萌)
251
- | | ---source_data # 原始数据集目录
252
- | | | - text.txt # 原始菜谱数据集
253
- | | ---data # 处理后的数据集目录
254
- | | | - caipu.txt # 处理后的菜谱数据集
255
258
| | ---chroma_db # chroma数据库目录
256
- | | | - chroma.sqlite3 # chroma库文件
259
+ | | | - chroma.sqlite3 # chroma数据库文件
260
+ | | ---data # 菜谱数据集目录
261
+ | | | - tran_dataset_1000.json # 只有1000条数据的测试菜谱数据集
257
262
| | ---faiss_index # FAISS数据库目录
258
263
| | | - index.faiss
259
264
| | | - index.pkl
260
265
| | ---retrieve # retrieve目录
261
- | | | - bm25retriever.pkl
262
- | | ---CookMasterLLM.py
263
- | | ---convert_txt.py
264
- | | ---create_db.py
265
- | | ---HyQEContextualCompressionRetriever.py
266
- | | ---interface.py
267
- | | ---rag_test.py
268
- | | ---run_local.py
269
- |
270
- | ---rag_chroma # 二代RAG代码目录(主要贡献者 @Charles)
271
- | | ---database # chroma数据库目录
272
- | | | - chroma.sqlite3 # chroma库文件
273
- | | ---LLM.py
274
- | | ---create_db.py
275
- | | ---interface.py
276
- |
277
- | ---src # 食材图标目录
278
- | | ---* .png # 各类食材图标
279
- |
280
- | ---tools # 工具文件目录
281
- |
282
- | ---whisper_app # whisper语音识别目录(主要贡献者 @solo fish)
283
- | | ---__init__.py # 初始化脚本
284
- | | ---whisper.py # 语音识别处理脚本
266
+ | | | - bm25retriever.pkl # 序列化保存的BM25retrieve
267
+ | | ---CookMasterLLM.py # langchain封装的大模型
268
+ | | ---create_db_json.py # 从json数据集文件创建向量数据库
269
+ | | ---HyQEContextualCompressionRetriever.py # HyQE检索器
270
+ | | ---interface.py # RAG模块接口
271
+ | | ---README.md # RAG模块说明
285
272
|
286
- | ---speech # paraformer语音识别目录(主要贡献者 @solo fish)
273
+ | ---speech # paraformer语音识别目录(主要贡献者 @solo fish)
287
274
| | ---__init__.py # 初始化脚本
288
275
| | ---utils.py # 语音识别处理脚本
289
276
|
290
- | ---requirements.txt # 系统依赖包(请使用pip install -r requirements.txt安装)
277
+ | ---app.py # Web Demo主脚本
278
+ | ---cli_demo.py # 模型测试脚本
291
279
| ---convert_t2s.py # 繁体字转简体字工具(主要贡献者 @彬彬)
280
+ | ---download.py # 模型下载脚本
292
281
| ---parse_cur_response.py # 输出格式化处理工具 (主要贡献者 @彬彬)
282
+ | ---start.py # streamlit启动脚本
283
+ | ---web_demo.py # Web Demo启动脚本
284
+ | ---requirements.txt # 系统依赖包(请使用pip install -r requirements.txt安装)
293
285
| ---README.md # 本文档
294
- | ---cli_demo.py # 模型测试脚本
295
- | ---download.py # 模型下载脚本
296
- | ---start.py # Web Demo启动脚本
297
- | ---app.py # Web Demo主脚本
298
-
299
- ```
286
+ ```
300
287
301
288
## ☕项目成员(排名不分先后)
302
289
@@ -316,21 +303,21 @@ print(response)
316
303
317
304
<p align =" center " ><b >感谢上海人工智能实验室组织的 书生·浦语实战营 学习活动~~~</b ></p >
318
305
319
- <div align =center ><img src =" https://github.com/SmartFlowAI/TheGodOfCookery/blob/main/images /shanghaiailab.png " /></div >
306
+ <div align =center ><img src =" https://github.com/SmartFlowAI/TheGodOfCookery/blob/main/assets /shanghaiailab.png " /></div >
320
307
321
308
<p align =" center " ><b >感谢 OpenXLab 对项目部署的算力支持~~~</b ></p >
322
309
323
- <div align =center ><img src =" https://github.com/SmartFlowAI/TheGodOfCookery/blob/main/images /openxlab.png " /></div >
310
+ <div align =center ><img src =" https://github.com/SmartFlowAI/TheGodOfCookery/blob/main/assets /openxlab.png " /></div >
324
311
325
312
<p align =" center " ><b >感谢 浦语小助手 对项目的支持~~~</b ></p >
326
313
327
- <div align =center ><img width = ' 150 ' height =' 150 ' src =" https://github.com/SmartFlowAI/TheGodOfCookery/blob/main/images /internlm.jpg " /></div >
314
+ <div align =center ><img width = ' 150 ' height =' 150 ' src =" https://github.com/SmartFlowAI/TheGodOfCookery/blob/main/assets /internlm.jpg " /></div >
328
315
329
316
## 加入我们
330
317
331
318
<p ><b >欢迎大模型爱好者入群参加讨论:</b ></p >
332
319
333
- <div align =center ><img width = ' 286 ' height =' 400 ' src =" https://github.com/SmartFlowAI/TheGodOfCookery/blob/main/images /qun.jpg " /></div >
320
+ <div align =center ><img width = ' 286 ' height =' 400 ' src =" https://github.com/SmartFlowAI/TheGodOfCookery/blob/main/assets /qun.jpg " /></div >
334
321
335
322
## 开源协议
336
323
0 commit comments