example.config.yml 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. logging: False#日志
  2. logging_path: "sqlite:///../record.db?check_same_thread=False"
  3. # 日志地址 可以连接远程mysql服务器:'mysql+pymysql://root:123456@localhost:3306/db?charset=utf8'
  4. port: 17860
  5. #webui 默认启动端口号"
  6. library:
  7. strategy: "calc:2 rtst:5 agents:0"
  8. #库参数,每组参数间用空格分隔,冒号前为知识库类型,后为抽取数量。
  9. #知识库类型:
  10. #serper 基于serper API的Google搜索,请在环境变量设置SERPER_API_KEY(https://serper.dev)
  11. #bing cn.bing搜索,仅国内可用,目前处于服务降级状态
  12. #sogowx sogo微信公众号搜索,可配合相应auto实现全文内容分析
  13. #fess fess搜索引擎
  14. #rtst 支持实时生成的sentence_transformers
  15. #remote 调用远程闻达知识库,用于集群化部署
  16. #kg 知识图谱,暂未启用
  17. #特殊库:
  18. #mix 根据参数进行多知识库融合
  19. #agents 提供网络资源代理,没有知识库查找功能,所以数量为0
  20. # (目前stable-diffusion的auto脚本需要使用其中功能,同时需开启stable-diffusion的api功能)
  21. count: 5
  22. #最大抽取数量(所有知识库总和)
  23. step: 2
  24. #知识库默认上下文步长
  25. librarys:
  26. bing:
  27. count:
  28. 5
  29. #最大抽取数量
  30. bingsite:
  31. count: 5
  32. #最大抽取数量
  33. site: "www.12371.cn"
  34. #搜索网站
  35. fess:
  36. count: 1
  37. #最大抽取数量
  38. fess_host: "127.0.0.1:8080"
  39. #fess搜索引擎的部署地址
  40. remote:
  41. host:
  42. "http://127.0.0.1:17860/api/find"
  43. #远程知识库地址地址
  44. rtst:
  45. count: 3
  46. #最大抽取数量
  47. # backend: Annoy
  48. size: 20
  49. #分块大小"
  50. overlap: 0
  51. #分块重叠长度
  52. # model_path: "http://127.0.0.1:8000/v1" #在线embedding
  53. model_path: "model/m3e-base"
  54. #向量模型存储路径
  55. device: cuda
  56. #embedding运行设备
  57. qdrant:
  58. path: txt
  59. #知识库文本路径
  60. model_path: "model/text2vec-large-chinese"
  61. #向量模型存储路径
  62. qdrant_host: "http://localhost:6333"
  63. #qdrant服务地址"
  64. device: cpu
  65. #qdrant运行设备
  66. collection: qa_collection
  67. #qdrant集合名称
  68. kg:
  69. count: 5
  70. #最大抽取数量
  71. knowledge_path: ""
  72. #知识库的文件夹目录名称,若留空则为txt
  73. graph_host: ""
  74. #图数据库部署地址
  75. model_path: ""
  76. #信息抽取模型所在路径"
  77. llm_type: rwkv
  78. #llm模型类型:glm6b、rwkv、llama、replitcode等,详见相关文件
  79. llm_models:
  80. rwkv:
  81. path: "model/rwkv-x060-3b-world-v2-28%trained-20231208-ctx4k.pth" #rwkv模型位置"
  82. # path: "model/RWKV-code-4-World-7B-20230820-ctx32k.pth" #rwkv模型位置"
  83. strategy: "cuda fp16"
  84. # path: "model/rwkv_ggml_q8.bin" #rwkv模型位置"
  85. # strategy: "Q8_0" #rwkvcpp:运行方式,设置strategy诸如"Q8_0->16"即可开启,代表运行Q8_0模型在16个cpu核心上
  86. #记得去https://github.com/saharNooby/rwkv.cpp/releases下最新版本文件替换librwkv.so或rwkv.dll
  87. #rwkv模型参数"
  88. historymode: state
  89. #rwkv历史记录实现方式:state、string。注意,对于torch实现,本参数已弃用,因为已经实现自动切换。
  90. state_source_device: cpu
  91. #torch实现下,会保存每个会话的state。每个占用2M显存,本参数控制将其复制到内存以节约显存。
  92. #置为cuda:0,代表state来自cuda:0,且需要将其复制到内存以节约显存。
  93. #置为cuda:1,同理。
  94. #置为cpu,代表不需要复制,如果使用cpu计算,或多卡计算需这么设置。
  95. presence_penalty: 0.2
  96. count_penalty: 0.2
  97. glm6b:
  98. path: "model\\chatglm3-6b"
  99. #glm模型位置"
  100. strategy: "cuda fp16"
  101. #cuda fp16 所有glm模型 要直接跑在gpu上都可以使用这个参数
  102. #cuda fp16i8 fp16原生模型 要自行量化为int8跑在gpu上可以使用这个参数
  103. #cuda fp16i4 fp16原生模型 要自行量化为int4跑在gpu上可以使用这个参数
  104. #cuda:0 fp16 *14 -> cuda:1 fp16 多卡流水线并行,使用方法参考RWKV的strategy介绍。总层数28
  105. # lora: "model/chatglm_fitness_lora"
  106. #glm-lora模型位置
  107. internlm:
  108. path: model\internlm-chat-7b-8k
  109. #模型位置"
  110. qwen:
  111. path: model\Qwen-7B-Chat
  112. #模型位置"
  113. baichuan:
  114. #模型名字中有gptq会进入gptq模式,不加载lora,且会加载basename中的模型
  115. #百川
  116. # path: "model\\Baichuan-13B-Chat"
  117. # user: "<human>"
  118. # answer: "<bot>"
  119. # interface: ":"
  120. #vicuna
  121. path: model\Baichuan2-13B-Chat-4bits
  122. user: "Human"
  123. answer: "Assistant"
  124. interface: ": "
  125. # basename: gptq_model-4bit-128g
  126. #lora模型位置"
  127. # lora: "model/64rank"
  128. generic_transformers:
  129. #模型名字中有gptq会进入gptq模式,不加载lora,且会加载basename中的模型
  130. #百川
  131. # path: "model\\Baichuan-13B-Chat"
  132. # user: "<human>"
  133. # answer: "<bot>"
  134. # interface: ":"
  135. #vicuna
  136. # path: model\Llama-2-13B-chat-GPTQ
  137. # user: "Human"
  138. # answer: "Assistant"
  139. # interface: ": "
  140. # basename: gptq_model-4bit-128g
  141. # stopping_text: "\nHuman:"
  142. #SUS-Chat-34B-AWQ
  143. path: model\SUS-Chat-34B-AWQ
  144. user: "### Human: "
  145. answer: "\n### Assistant:\n"
  146. interface: ""
  147. stopping_text: "### Human: "
  148. #lora模型位置"
  149. # lora: "model/64rank"
  150. aquila:
  151. path: "AquilaChat-7B"
  152. #模型位置"
  153. strategy: "cuda fp16"
  154. llama:
  155. path: "model/stable-vicuna-13B.ggml.q4_2.bin"
  156. #llama模型位置
  157. # strategy: "Q8_0" #cpp:运行方式,设置strategy诸如"Q8_0"即可开启
  158. strategy: "cuda fp16i8"
  159. moss:
  160. path: "model/moss-moon-003-sft-plugin-int4"
  161. #模型位置
  162. strategy: ""
  163. #模型参数 暂时不用"
  164. openai:
  165. # api_host: "https://gpt.lucent.blog/v1" #网友的反代
  166. # api_host: "https://api.openai.com/v1" #官方地址
  167. api_host: "http://127.0.0.1:8000/v1" #rwkv runner
  168. # api_host: "http://127.0.0.1:3000/v1" #rwkv ai00
  169. replitcode:
  170. path: "model/replit-code-v1-3b"
  171. #replitcode模型位置
  172. #说明:目前模型参数和chat模型差异较大,写死了,不能通过wenda界面配置,需要调整自行到llm_replitcode.py 文件中调整,或放开wenda界面参数
  173. #y = model.generate(x, max_length=100, do_sample=true, top_p=0.95, top_k=4, temperature=0.2, num_return_sequences=1, eos_token_id=tokenizer.eos_token_id)
  174. #模型地址:https://huggingface.co/replit/replit-code-v1-3b ,约10g
  175. #作用代码补全:问:def fibonacci(n):
  176. #答:def fibonacci(n):
  177. #if n == 0:
  178. #return 0
  179. #elif n == 1:
  180. #return 1
  181. #else:
  182. #return fibonacci(n-1) + fibonacci(n-2)
  183. #print(fibonacci(10))
  184. strategy: "cuda fp16"
  185. #因我的3070只有8g内存,所以是先把模理加载到内存进行精度转换,至少要32g系统内存, fp16 占用不到6g显存,fp32 超过8g未测试"
粤ICP备19079148号