quincyqiang commited on
Commit
7a63b2c
1 Parent(s): e81ef86

update@todo

Browse files
Files changed (2) hide show
  1. app.py +2 -5
  2. main.py +2 -4
app.py CHANGED
@@ -1,7 +1,6 @@
1
  import os
2
  import shutil
3
 
4
- from app_modules.overwrites import postprocess
5
  from app_modules.presets import *
6
  from clc.langchain_application import LangChainApplication
7
 
@@ -50,6 +49,7 @@ def set_knowledge(kg_name, history):
50
  application.source_service.load_vector_store(config.kg_vector_stores[kg_name])
51
  msg_status = f'{kg_name}知识库已成功加载'
52
  except Exception as e:
 
53
  msg_status = f'{kg_name}知识库未成功加载'
54
  return history + [[None, msg_status]]
55
 
@@ -145,10 +145,7 @@ with gr.Blocks(css=customCSS, theme=small_and_beautiful_theme) as demo:
145
  value='模型问答',
146
  interactive=True)
147
 
148
- kg_name = gr.Radio(['中文维基百科',
149
- '大规模金融研报知识图谱',
150
- '初始化知识库'
151
- ],
152
  label="知识库",
153
  value=None,
154
  info="使用知识库问答,请加载知识库",
 
1
  import os
2
  import shutil
3
 
 
4
  from app_modules.presets import *
5
  from clc.langchain_application import LangChainApplication
6
 
 
49
  application.source_service.load_vector_store(config.kg_vector_stores[kg_name])
50
  msg_status = f'{kg_name}知识库已成功加载'
51
  except Exception as e:
52
+ print(e)
53
  msg_status = f'{kg_name}知识库未成功加载'
54
  return history + [[None, msg_status]]
55
 
 
145
  value='模型问答',
146
  interactive=True)
147
 
148
+ kg_name = gr.Radio(list(config.kg_vector_stores.keys()),
 
 
 
149
  label="知识库",
150
  value=None,
151
  info="使用知识库问答,请加载知识库",
main.py CHANGED
@@ -50,6 +50,7 @@ def set_knowledge(kg_name, history):
50
  application.source_service.load_vector_store(config.kg_vector_stores[kg_name])
51
  msg_status = f'{kg_name}知识库已成功加载'
52
  except Exception as e:
 
53
  msg_status = f'{kg_name}知识库未成功加载'
54
  return history + [[None, msg_status]]
55
 
@@ -145,10 +146,7 @@ with gr.Blocks(css=customCSS, theme=small_and_beautiful_theme) as demo:
145
  value='模型问答',
146
  interactive=True)
147
 
148
- kg_name = gr.Radio(['中文维基百科',
149
- '大规模金融研报知识图谱',
150
- '初始化知识库'
151
- ],
152
  label="知识库",
153
  value=None,
154
  info="使用知识库问答,请加载知识库",
 
50
  application.source_service.load_vector_store(config.kg_vector_stores[kg_name])
51
  msg_status = f'{kg_name}知识库已成功加载'
52
  except Exception as e:
53
+ print(e)
54
  msg_status = f'{kg_name}知识库未成功加载'
55
  return history + [[None, msg_status]]
56
 
 
146
  value='模型问答',
147
  interactive=True)
148
 
149
+ kg_name = gr.Radio(list(config.kg_vector_stores.keys()),
 
 
 
150
  label="知识库",
151
  value=None,
152
  info="使用知识库问答,请加载知识库",