Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
Q
QASystemOnMedicalKG
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lishen
QASystemOnMedicalKG
Commits
9e46a0d9
Commit
9e46a0d9
authored
Apr 19, 2023
by
lishen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[add] gr.Markdown
parent
424a8483
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
6 deletions
+26
-6
chatbot_graph.py
chatbot_graph.py
+26
-6
dcaa038b23790b7dd6ba5569d01d5062.jpeg
sources/dcaa038b23790b7dd6ba5569d01d5062.jpeg
+0
-0
No files found.
chatbot_graph.py
View file @
9e46a0d9
...
@@ -43,11 +43,31 @@ class ChatBotGraph:
...
@@ -43,11 +43,31 @@ class ChatBotGraph:
# answer = handler.chat_main(question)
# answer = handler.chat_main(question)
# print('小益:', answer)
# print('小益:', answer)
if
__name__
==
'__main__'
:
with
gr
.
Blocks
()
as
demo
:
gr
.
close_all
()
handler
=
ChatBotGraph
()
handler
=
ChatBotGraph
()
# 接口创建函数
gr
.
Markdown
(
# fn设置处理函数,inputs设置输入接口组件,outputs设置输出接口组件
"""
# fn,inputs,outputs都是必填函数
# 健康知识问答介绍
demo
=
gr
.
Interface
(
fn
=
handler
.
chat_main
,
inputs
=
"text"
,
outputs
=
"text"
)
1、左侧输入框输入你想问的问题
2、点击Submit按钮提交问题,右侧输出框会返回对应的答案
3、Clear按钮清空输入框
4、Flag按钮可记录当前的问题和答案,如果测试时对该问答不满意可点击Flag记录,管理员可查看记录
# 需要做什么?
1、参考腾讯文档内列举的问题类型,测试能想到的所有其他问法,无法回答的问题整理下来,反馈给李甡
2、对问题的回答是否满意,不满意整理下来
腾讯文档:https://docs.qq.com/sheet/DRHRKdkpOZ05yd29Z?tab=BB08J2
"""
)
gr
.
Interface
(
fn
=
handler
.
chat_main
,
inputs
=
"text"
,
outputs
=
"text"
,
)
demo
.
launch
(
share
=
True
,
server_name
=
"0.0.0.0"
)
if
__name__
==
'__main__'
:
demo
.
launch
(
share
=
True
,
server_name
=
"0.0.0.0"
,
server_port
=
7860
,
favicon_path
=
"sources/dcaa038b23790b7dd6ba5569d01d5062.jpeg"
)
sources/dcaa038b23790b7dd6ba5569d01d5062.jpeg
0 → 100644
View file @
9e46a0d9
37.1 KB
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment