You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
2.3 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

import argparse
import torch
parser = argparse.ArgumentParser()
parser.add_argument('--original_data_path', type=str, default='模型数据/菜单推荐')
parser.add_argument('--preprocessed_data_path', type=str, default='vectorstores/caidantuijian')
parser.add_argument('--original_data_path_g', type=str, default='模型数据/菜单规划')
parser.add_argument('--preprocessed_data_path_g', type=str, default='vectorstores/caidanguihua')
parser.add_argument('--embeddings_model_name', type=str, default='moka-ai/m3e-large')
parser.add_argument("--topk", type=int, default=5) #模型回答topk
parser.add_argument("--topk_1", type=int, default=5) #知识库的返回的tok
parser.add_argument("--lenhistory", type=int, default=5) #上下文历史长度
#parser.add_argument("--fenci", type=int, default=150) #文档切分最大长度
parser.add_argument('--pretrained_model_name',type=str,default='THUDM/chatglm2-6b-int4')
parser.add_argument("--temperature", type=float, default=0.1) #模型输出温度
parser.add_argument('--path_caidan', type=str, default='模型数据/商户菜单/小饭店菜单.pdf')
parser.add_argument('--path_zidingyi', type=str, default='模型数据/菜品清单.txt')
parser.add_argument("--num_select", type=int, default=2)
parser.add_argument("--chunk_size", type=int, default=100) #数据切分的长度
parser.add_argument("--chunk_overlap", type=int, default=10) #数据切分允许的重叠长度
parser.add_argument("--top_num", type=int, default=3) #图片识别topk
parser.add_argument("--filter_threshold", type=float, default=0.7) #图片识别阈值
parser.add_argument("--baike_num", type=int, default=3) #图片识别展示的百科数
args = parser.parse_args()
args.device = "cuda" if torch.cuda.is_available() else "cpu"
args.xihao = '豆芽,牛肉,川菜,豆腐,蔬菜'
'''api申请方法见https://blog.csdn.net/2303_79001442/article/details/132093208 '''
##菜品识别API
args.APP_ID_c = '36759749'
args.API_KEY_c= 'G2eUrTDLXsVYNeSLVPSQQsDR'
args.SECRET_KEY_c = 'T7TBOPP8EOprcWhKzOGIu0Tdtdwjrgar'
##果蔬识别API
args.APP_ID_g = '36759878'
args.API_KEY_g = 'bwdn6X3RouhTxGm3njcwpFdA'
args.SECRET_KEY_g = 'BRgG1YtEcEkASrXGL4bw3TvwZkDhTwDq'
#windows系统NLP模型下载地址 C:\Users\Administrator\.cache\huggingface
#windows系统Embedding模型下载地址 C:\Users\Administrator\.cache\torch\sentence_transformers