Skip to content

Commit fae16b5

Browse files
committed
二期工程开始
1 parent e898fea commit fae16b5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+312
-4137
lines changed

README.md

+43-56
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<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"/>
33
<br /><br />
44

55
[中文](https://github.com/SmartFlowAI/TheGodOfCookery/blob/main/README.md) | [English](https://github.com/SmartFlowAI/TheGodOfCookery/blob/main/README_EN.md)
@@ -13,12 +13,12 @@
1313
[![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)
1414

1515
</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>
1818

1919
<p align="center"><b style="font-size:larger">《食神》项目获上海人工智能实验室主办的2024浦源大模型系列挑战赛春季赛创新创意奖!!!</b></p>
2020

21-
![](images/2024_PuYuan_Competition_certificate.png)
21+
![](assets/2024_PuYuan_Competition_certificate.png)
2222
## 📍目录
2323
- [📍目录](#目录)
2424
- [📖项目简介](#项目简介)
@@ -56,13 +56,13 @@
5656

5757
​ 项目主要依赖上海人工智能实验室开源模型internlm-chat-7b(包含1代和2代),在XiaChuFang Recipe Corpus 提供的1,520,327种中国食谱数据集上借助Xtuner进行LoRA微调,形成shishen2_full模型,并将微调后模型与向量数据库整合入langchain,实现RAG检索增强的效果,并可进行多模态(语音、文字、图片)问答对话,前端基于streamlit实现与用户的交互。
5858

59-
![](images/整体技术架构.png)
59+
![](assets/整体技术架构.png)
6060

6161
### 2. 应用整体流程
6262

6363
​ 用户发出请求后,应用加载模型(语音模型,文生图模型,微调后的对话模型),并处理用户的文字输入或者语音输入,如果未打开RAG开关,则直接调用微调后的对话模型生成回复,对结果进行格式化输出,并调用stable diffusion模型生成图片,最后将相应结果返回用户;如果打开RAG开关,则利用langchain检索向量数据库,并将检索结果输入微调后的对话模型生成回复,对结果进行格式化输出,并调用stable diffusion模型生成图片,最后将相应结果返回用户。
6464

65-
![](images/处理流程.png)
65+
![](assets/处理流程.png)
6666

6767
## ✨技术报告
6868

@@ -171,17 +171,17 @@ xtuner chat ${SAVE_PATH} [optional arguments]
171171

172172
Demo 访问地址:[A100](https://openxlab.org.cn/apps/detail/zhanghui-china/shishen2024) [A10](https://openxlab.org.cn/apps/detail/zhanghui-china/shishen2024_1.8b)
173173

174-
![1710422208862](images/1710422208862.png)
174+
![1710422208862](assets/1710422208862.png)
175175

176-
![1710422224731](images/1710422224731.png)
176+
![1710422224731](assets/1710422224731.png)
177177

178178
一阶段对话效果(纯文本对话):
179179

180180
Demo 样例
181181

182-
![answer001](images/answer001.png)
182+
![answer001](assets/answer001.png)
183183

184-
![answer002](images/answer002.png)
184+
![answer002](assets/answer002.png)
185185

186186
### 6. 模型地址
187187

@@ -227,8 +227,13 @@ print(response)
227227

228228
二阶段
229229

230-
```shell
230+
```shell
231231
项目目录
232+
|---assets # 图片目录,生成的图片临时也放在这里,今后会考虑迁移到其他目录
233+
| |---robot.png #对话机器人图标
234+
| |---user.png #对话用户图标
235+
| |---shishen.png #项目图标 (主要贡献者 @刘光磊)
236+
|
232237
|---config # 配置文件目录(主要贡献者 @房宇亮)
233238
| |---__init__.py #初始化脚本
234239
| |---config.py #配置脚本
@@ -237,66 +242,48 @@ print(response)
237242
| |---tech_report.md #技术报告
238243
| |---Introduce_x.x.pdf #项目介绍PPT
239244
|
245+
|---eval # RAG模块评测目录
246+
|
247+
|---food_icon # 食材图标目录
248+
| |---*.png #各类食材图标
249+
|
240250
|---gen_image # 文生图目录(主要贡献者 @房宇亮)
241251
| |---__init__.py #初始化脚本
242252
| |---sd_gen_image.py #使用Stabble Disffion的文生图模块
243253
| |---zhipu_ai_image.py #使用智谱AI的文生图模块
244254
|
245-
|---images # 的图片目录,生成的图片临时也放在这里,今后会考虑迁移到其他目录
246-
| |---robot.png #对话机器人图标
247-
| |---user.png #对话用户图标
248-
| |---shishen.png #项目图标 (主要贡献者 @刘光磊)
255+
|---images # 暂存文生图模型生成的图片的目录
249256
|
250257
|---rag # 二代RAG代码目录(主要贡献者 @乐正萌)
251-
| |---source_data #原始数据集目录
252-
| | |- text.txt #原始菜谱数据集
253-
| |---data #处理后的数据集目录
254-
| | |- caipu.txt #处理后的菜谱数据集
255258
| |---chroma_db #chroma数据库目录
256-
| | |- chroma.sqlite3 #chroma库文件
259+
| | |- chroma.sqlite3 #chroma数据库文件
260+
| |---data #菜谱数据集目录
261+
| | |- tran_dataset_1000.json #只有1000条数据的测试菜谱数据集
257262
| |---faiss_index #FAISS数据库目录
258263
| | |- index.faiss
259264
| | |- index.pkl
260265
| |---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模块说明
285272
|
286-
|---speech # paraformer语音识别目录(主要贡献者 @solo fish)
273+
|---speech # paraformer语音识别目录(主要贡献者 @solo fish)
287274
| |---__init__.py #初始化脚本
288275
| |---utils.py #语音识别处理脚本
289276
|
290-
|---requirements.txt #系统依赖包(请使用pip install -r requirements.txt安装)
277+
|---app.py #Web Demo主脚本
278+
|---cli_demo.py #模型测试脚本
291279
|---convert_t2s.py #繁体字转简体字工具(主要贡献者 @彬彬)
280+
|---download.py #模型下载脚本
292281
|---parse_cur_response.py #输出格式化处理工具 (主要贡献者 @彬彬)
282+
|---start.py #streamlit启动脚本
283+
|---web_demo.py #Web Demo启动脚本
284+
|---requirements.txt #系统依赖包(请使用pip install -r requirements.txt安装)
293285
|---README.md #本文档
294-
|---cli_demo.py #模型测试脚本
295-
|---download.py #模型下载脚本
296-
|---start.py #Web Demo启动脚本
297-
|---app.py #Web Demo主脚本
298-
299-
```
286+
```
300287

301288
## ☕项目成员(排名不分先后)
302289

@@ -316,21 +303,21 @@ print(response)
316303

317304
<p align="center"><b>感谢上海人工智能实验室组织的 书生·浦语实战营 学习活动~~~</b></p>
318305

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>
320307

321308
<p align="center"><b>感谢 OpenXLab 对项目部署的算力支持~~~</b></p>
322309

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>
324311

325312
<p align="center"><b>感谢 浦语小助手 对项目的支持~~~</b></p>
326313

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>
328315

329316
## 加入我们
330317

331318
<p><b>欢迎大模型爱好者入群参加讨论:</b></p>
332319

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>
334321

335322
## 开源协议
336323

0 commit comments

Comments
 (0)