zhaokeyao1
commited on
Commit
·
347f513
1
Parent(s):
204c5db
Update content
Browse files
app.py
CHANGED
|
@@ -155,7 +155,7 @@ client=OpenAI(
|
|
| 155 |
)
|
| 156 |
def predict_issue(password_input, user_in_file):
|
| 157 |
if password_input != os.environ.get("USER_KEY"):
|
| 158 |
-
return [(None, "Wrong password!")]
|
| 159 |
file = client.files.create(file=Path(user_in_file), purpose="file-extract")
|
| 160 |
completion = client.chat.completions.create(
|
| 161 |
model="qwen-long",
|
|
@@ -170,7 +170,7 @@ def predict_issue(password_input, user_in_file):
|
|
| 170 |
},
|
| 171 |
{
|
| 172 |
'role': 'user',
|
| 173 |
-
'content': ''
|
| 174 |
}
|
| 175 |
],
|
| 176 |
stream=True
|
|
@@ -184,7 +184,7 @@ def predict_issue(password_input, user_in_file):
|
|
| 184 |
yield history
|
| 185 |
def predict_mindmap(password_input, user_in_file):
|
| 186 |
if password_input != os.environ.get("USER_KEY"):
|
| 187 |
-
return [(None, "Wrong password!")]
|
| 188 |
file = client.files.create(file=Path(user_in_file), purpose="file-extract")
|
| 189 |
completion = client.chat.completions.create(
|
| 190 |
model="qwen-long",
|
|
@@ -199,7 +199,7 @@ def predict_mindmap(password_input, user_in_file):
|
|
| 199 |
},
|
| 200 |
{
|
| 201 |
'role': 'user',
|
| 202 |
-
'content': ''
|
| 203 |
}
|
| 204 |
],
|
| 205 |
stream=True
|
|
@@ -213,7 +213,7 @@ def predict_mindmap(password_input, user_in_file):
|
|
| 213 |
yield history
|
| 214 |
def predict_keywords(password_input, user_in_file):
|
| 215 |
if password_input != os.environ.get("USER_KEY"):
|
| 216 |
-
return [(None, "Wrong password!")]
|
| 217 |
file = client.files.create(file=Path(user_in_file), purpose="file-extract")
|
| 218 |
completion = client.chat.completions.create(
|
| 219 |
model="qwen-long",
|
|
@@ -228,7 +228,7 @@ def predict_keywords(password_input, user_in_file):
|
|
| 228 |
},
|
| 229 |
{
|
| 230 |
'role': 'user',
|
| 231 |
-
'content': ''
|
| 232 |
}
|
| 233 |
],
|
| 234 |
stream=True
|
|
@@ -242,7 +242,7 @@ def predict_keywords(password_input, user_in_file):
|
|
| 242 |
yield history
|
| 243 |
def predict_dynamics(password_input, user_in_file):
|
| 244 |
if password_input != os.environ.get("USER_KEY"):
|
| 245 |
-
return [(None, "Wrong password!")]
|
| 246 |
file = client.files.create(file=Path(user_in_file), purpose="file-extract")
|
| 247 |
completion = client.chat.completions.create(
|
| 248 |
model="qwen-long",
|
|
@@ -257,7 +257,7 @@ def predict_dynamics(password_input, user_in_file):
|
|
| 257 |
},
|
| 258 |
{
|
| 259 |
'role': 'user',
|
| 260 |
-
'content': ''
|
| 261 |
}
|
| 262 |
],
|
| 263 |
stream=True
|
|
@@ -271,7 +271,7 @@ def predict_dynamics(password_input, user_in_file):
|
|
| 271 |
yield history
|
| 272 |
def predict_complaint(password_input, user_in_file):
|
| 273 |
if password_input != os.environ.get("USER_KEY"):
|
| 274 |
-
return [(None, "Wrong password!")]
|
| 275 |
file = client.files.create(file=Path(user_in_file), purpose="file-extract")
|
| 276 |
completion = client.chat.completions.create(
|
| 277 |
model="qwen-long",
|
|
@@ -286,7 +286,7 @@ def predict_complaint(password_input, user_in_file):
|
|
| 286 |
},
|
| 287 |
{
|
| 288 |
'role': 'user',
|
| 289 |
-
'content': ''
|
| 290 |
}
|
| 291 |
],
|
| 292 |
stream=True
|
|
@@ -300,7 +300,7 @@ def predict_complaint(password_input, user_in_file):
|
|
| 300 |
yield history
|
| 301 |
def predict_concept(password_input, user_in_file):
|
| 302 |
if password_input != os.environ.get("USER_KEY"):
|
| 303 |
-
return [(None, "Wrong password!")]
|
| 304 |
file = client.files.create(file=Path(user_in_file), purpose="file-extract")
|
| 305 |
completion = client.chat.completions.create(
|
| 306 |
model="qwen-long",
|
|
@@ -315,7 +315,7 @@ def predict_concept(password_input, user_in_file):
|
|
| 315 |
},
|
| 316 |
{
|
| 317 |
'role': 'user',
|
| 318 |
-
'content': ''
|
| 319 |
}
|
| 320 |
],
|
| 321 |
stream=True
|
|
@@ -330,7 +330,7 @@ def predict_concept(password_input, user_in_file):
|
|
| 330 |
|
| 331 |
def predict_plan(password_input, user_in_file):
|
| 332 |
if password_input != os.environ.get("USER_KEY"):
|
| 333 |
-
return [(None, "Wrong password!")]
|
| 334 |
file = client.files.create(file=Path(user_in_file), purpose="file-extract")
|
| 335 |
completion = client.chat.completions.create(
|
| 336 |
model="qwen-long",
|
|
@@ -345,7 +345,7 @@ def predict_plan(password_input, user_in_file):
|
|
| 345 |
},
|
| 346 |
{
|
| 347 |
'role': 'user',
|
| 348 |
-
'content': ''
|
| 349 |
}
|
| 350 |
],
|
| 351 |
stream=True
|
|
@@ -360,7 +360,7 @@ def predict_plan(password_input, user_in_file):
|
|
| 360 |
|
| 361 |
def predict_highlight(password_input, user_in_file):
|
| 362 |
if password_input != os.environ.get("USER_KEY"):
|
| 363 |
-
return [(None, "Wrong password!")]
|
| 364 |
file = client.files.create(file=Path(user_in_file), purpose="file-extract")
|
| 365 |
completion = client.chat.completions.create(
|
| 366 |
model="qwen-long",
|
|
@@ -408,7 +408,7 @@ with gr.Blocks(css="#chatbot{height:350px} .overflow-y-auto{height:600px}") as d
|
|
| 408 |
mindmap_button = gr.Button("Mindmap")
|
| 409 |
keywords_button = gr.Button("Keywords")
|
| 410 |
dynamics_button = gr.Button("Dynamics")
|
| 411 |
-
complaint_button = gr.Button("Main
|
| 412 |
concept_button = gr.Button("Case Conceptualization")
|
| 413 |
highlight_button = gr.Button("Highlights")
|
| 414 |
plan_button = gr.Button("Follow-up Plan")
|
|
|
|
| 155 |
)
|
| 156 |
def predict_issue(password_input, user_in_file):
|
| 157 |
if password_input != os.environ.get("USER_KEY"):
|
| 158 |
+
return [(None, "Wrong password!")]
|
| 159 |
file = client.files.create(file=Path(user_in_file), purpose="file-extract")
|
| 160 |
completion = client.chat.completions.create(
|
| 161 |
model="qwen-long",
|
|
|
|
| 170 |
},
|
| 171 |
{
|
| 172 |
'role': 'user',
|
| 173 |
+
'content': '������ѯ�ĸ����ݣ������ѯ�������ݵ��������ܽᣬ�ֱ���һ�仰�����������ߵģ�1����Ҫ���⣺���������ߵ�ǰ������������֡�\n 2��������Ϣ����������������Ҫ������صı�����Ϣ��\n 3�����������ߣ�����������ǰ����ѯ����Ҫ������ڴ���\n 4����ѯ����������������ǰ����ѯ����Ҫ������\n �������ڸ���¼��������������ݡ�ע�⣺��д���ݺ�ֹͣһ����������������ܽᡣ'
|
| 174 |
}
|
| 175 |
],
|
| 176 |
stream=True
|
|
|
|
| 184 |
yield history
|
| 185 |
def predict_mindmap(password_input, user_in_file):
|
| 186 |
if password_input != os.environ.get("USER_KEY"):
|
| 187 |
+
return [(None, "Wrong password!")]
|
| 188 |
file = client.files.create(file=Path(user_in_file), purpose="file-extract")
|
| 189 |
completion = client.chat.completions.create(
|
| 190 |
model="qwen-long",
|
|
|
|
| 199 |
},
|
| 200 |
{
|
| 201 |
'role': 'user',
|
| 202 |
+
'content': '��������������ѯ����ר�ң�����Ҫ����ѯʦ����ѯ���ݽ��ж�����������ѯ���̽��зֶκͶ�����������ٰ���2-4����Ҫ��֧��ÿ����Ҫ��֧����2-4����Ҫ��֧'
|
| 203 |
}
|
| 204 |
],
|
| 205 |
stream=True
|
|
|
|
| 213 |
yield history
|
| 214 |
def predict_keywords(password_input, user_in_file):
|
| 215 |
if password_input != os.environ.get("USER_KEY"):
|
| 216 |
+
return [(None, "Wrong password!")]
|
| 217 |
file = client.files.create(file=Path(user_in_file), purpose="file-extract")
|
| 218 |
completion = client.chat.completions.create(
|
| 219 |
model="qwen-long",
|
|
|
|
| 228 |
},
|
| 229 |
{
|
| 230 |
'role': 'user',
|
| 231 |
+
'content': '������ѯ�ĸ����ݣ������½Ƕȷ��������ߵ����ʣ�1����������ѧ�����������ߵ����ij�ͻ���������ơ����״̬�Լ��������Ӱ����Ϊ��2���˸����ʣ��������õĿ����ԡ������ԡ������ԡ������ԡ������ȶ��ԡ������˸�������Ӧ��������ύ���Ͷ������ֵ�ۡ�3����֪ģʽ�����������ߵ�˼άģʽ��������֪ƫ�������ϵ�ȡ�4������״̬�����������ߵ������ȶ��ԡ��������﷽ʽ�Լ���������������5����Ϊģʽ�����������ߵ���Ϊϰ�ߡ�Ӧ�Բ����Լ���Ϊ�Ե�ǰ�����Ӱ�졣6��Ӧ����Դ��Ӧ�Է�ʽ�����������߿��õ���Դ��Ӧ��ѹ���ķ�ʽ�����ֱ����������֪����Ϊ��ϵ�ĸ����棬��ȡ�����߹ؼ����ʣ�������3-4���ؼ��ʡ������¸�ʽ�����1������ \n �ؼ����ʣ������������� \n �ؼ��ʣ����ǡ��������־�'
|
| 232 |
}
|
| 233 |
],
|
| 234 |
stream=True
|
|
|
|
| 242 |
yield history
|
| 243 |
def predict_dynamics(password_input, user_in_file):
|
| 244 |
if password_input != os.environ.get("USER_KEY"):
|
| 245 |
+
return [(None, "Wrong password!")]
|
| 246 |
file = client.files.create(file=Path(user_in_file), purpose="file-extract")
|
| 247 |
completion = client.chat.completions.create(
|
| 248 |
model="qwen-long",
|
|
|
|
| 257 |
},
|
| 258 |
{
|
| 259 |
'role': 'user',
|
| 260 |
+
'content': '����������ѯ����ר�ң�����Ҫ����ѯʦ����ѯ���ݽ��ж���������1�����Ķ����ϴ����ı��ļ���ȫ����ѯ���ݣ�ֱ�����һ���ַ�������2 ���������¿�ܶ���ѯ�������֣�0��Ϊ��ȫ�����ϣ�10��Ϊ��ȫ���ϣ�����¼���ֺ�ԭ�����ı���δ�ἰ������ݿɺ������֣�1����������ѯʦ�Ƿ���Ч�ؿ�������ȷ�˱�����ѯ��Ŀ�ĺ�Ԥ�ڡ�2��������ϵ����ѯʦ�Ƿ�����ѯ��ʼʱ�����˻����Ĺ�����ϵ��\n �ͻ��Ƿ�е������������⡣3��������ͨ����ѯʦ�Ƿ�չ�ֳ��������������ɣ������̽�������ߵĸ��ܣ�����������ͣ���ڱ������ͬ��\n ��ͨ�Ƿ����������������������������ҹ����������Լ����֡���������Լ��ĸ��ܺ���Ϊ��4������֧�֣��Ƿ����������ʶ��ʹ�����������������̽�������ߵ����������ԭ��\n ��ѯʦ�Ƿ��ṩ���ʵ���������Ӧ��֧�֡�5��Ŀ��۽����Ƿ�Χ�Ƽȶ�Ŀ�������ѯ��\n Ŀ���Ƿ��ʺ������ߵ�ǰ�������������õ���ͬ�Ͳ��롣6����Ԥʵʩ����ѯʦ�Ƿ�ʹ���˺��ʵĸ�Ԥ���ԡ�\n ��Ԥ�ͼ���ʹ���Ƿ���ͻ�����Ҫ��Ŀ�������7���仯���������������߶Ի�̸�ķ�Ӧ��������С���֪����Ϊ�ϵı仯�� \n �����ڻ�̸������Ŀ���ʵ�̶ֳȣ��������Ƿ�������չ��8���������ܽ��ѯʦ�Ƿ��ṩ�˼�ʱ�ķ�����\n ��ѯʦ�Ƿ�չ�ֳ����Լ���Ϊ�ͷ�Ӧ����ʶ��9����̸�Ľṹ��������̸�Ƿ��������Ľṹ���������롢�������ۺ��ܽ�Ȳ��֡�\n ������̸�������ԣ������Ի��������Ժ�ת������Ȼ�ԡ�10�������������Ƿ���Ȼ���Ƿ�����Ч���ܽᣬ�������Ƿ�õ������õķ�����\n �Ƿ�Ϊ��һ����ѯ������ж�������������ָ�����Ƿ��������߲��뵽����ܽ����������ǿ�����ߵIJ���к���ѯ�ĸ��Ի�������3������2��������������¸�ʽ�����1��������ϵ��\n ���֣���\n ԭ�����������ԭ�ķ�������'
|
| 261 |
}
|
| 262 |
],
|
| 263 |
stream=True
|
|
|
|
| 271 |
yield history
|
| 272 |
def predict_complaint(password_input, user_in_file):
|
| 273 |
if password_input != os.environ.get("USER_KEY"):
|
| 274 |
+
return [(None, "Wrong password!")]
|
| 275 |
file = client.files.create(file=Path(user_in_file), purpose="file-extract")
|
| 276 |
completion = client.chat.completions.create(
|
| 277 |
model="qwen-long",
|
|
|
|
| 286 |
},
|
| 287 |
{
|
| 288 |
'role': 'user',
|
| 289 |
+
'content': '��Ϊ�������������ר�ң����ڽ�����ѯ���ߺͻ�̸Ŀ�����ʱ����������¿�������������������ߵ������1������������ \n��Ҫ���⣺���������ߵ�ǰ������������֡�\n ������Ϣ����������������Ҫ������صı�����Ϣ��\n ���������ߣ�����������ǰ����ѯ����Ҫ������ڴ���\n ��ѯ����������������ǰ����ѯ����Ҫ������\n �������ڸ���¼��������������ݡ�ע�⣺��д���ݺ�ֹͣһ����������������ܽᡣ'
|
| 290 |
}
|
| 291 |
],
|
| 292 |
stream=True
|
|
|
|
| 300 |
yield history
|
| 301 |
def predict_concept(password_input, user_in_file):
|
| 302 |
if password_input != os.environ.get("USER_KEY"):
|
| 303 |
+
return [(None, "Wrong password!")]
|
| 304 |
file = client.files.create(file=Path(user_in_file), purpose="file-extract")
|
| 305 |
completion = client.chat.completions.create(
|
| 306 |
model="qwen-long",
|
|
|
|
| 315 |
},
|
| 316 |
{
|
| 317 |
'role': 'user',
|
| 318 |
+
'content': '��Ϊ�������������ר�ң����ڽ��и������ʱ����������¿�������������������ߵ������1���˿�ͳ��ѧ��Ϣ�����������ߵ����䡢�Ա����塢����������ְҵ״̬�Ȼ�����Ϣ��2����չʷ�����������ߵijɳ�������������ͥ���������ھ������������̵ȡ�3�����������ʷ�����������ߵ���Ҫ�����¼����˼ʹ�ϵ�����֧��ϵͳ�ȡ�4����������ʷ�����������ߵ���������״����������ȥ�����ڵ��������⡢������ʷ�ȡ�5����������ѧ�����������ߵ����ij�ͻ���������ơ����״̬�Լ��������Ӱ����Ϊ��6�������ʣ��������õĿ����ԡ������ԡ������ԡ������ԡ������ȶ��ԡ������˸�������Ӧ��������ύ�����������ֵ�ۡ�7����֪ģʽ�����������ߵ�˼άģʽ��������֪ƫ�������ϵ�ȡ�8������״̬�����������ߵ������ȶ��ԡ��������﷽ʽ�Լ���������������9����Ϊģʽ�����������ߵ���Ϊϰ�ߡ�Ӧ�Բ����Լ���Ϊ�Ե�ǰ�����Ӱ�졣10��Ӧ����Դ��Ӧ�Է�ʽ�����������߿��õ���Դ��Ӧ��ѹ���ķ�ʽ��11����ǰ����״��������������Ŀǰ������״�����繤����ѧϰ����ͥ����罻�˼ʻ�ȡ�12�����ӡ���г���ص����ӡ����DSM������ᡣ13���������������������߿��ܴ��ڵķ������أ�����ɱ���ա������˺����յȡ��������ڸ���¼������������������漰��������ʱʹ�����¸�ʽ���������ػ�����ض��䣨{�����á�����}���������������ܽᡣ'
|
| 319 |
}
|
| 320 |
],
|
| 321 |
stream=True
|
|
|
|
| 330 |
|
| 331 |
def predict_plan(password_input, user_in_file):
|
| 332 |
if password_input != os.environ.get("USER_KEY"):
|
| 333 |
+
return [(None, "Wrong password!")]
|
| 334 |
file = client.files.create(file=Path(user_in_file), purpose="file-extract")
|
| 335 |
completion = client.chat.completions.create(
|
| 336 |
model="qwen-long",
|
|
|
|
| 345 |
},
|
| 346 |
{
|
| 347 |
'role': 'user',
|
| 348 |
+
'content': '�����������������ר�ң������ƶ�δ����ѯ�ƻ��Ĺ滮ʱ��ͨ�����������¼������ά�������У�1�����Ƽƻ���ά��1����ǰ״������ - ���ݱ��λ�̸���ݣ����������ߵ�����״̬����֪ģʽ����Ϊ�����Լ���Ṧ�ܡ� \n ά��2��Ŀ��ϸ�� - ����Զ������Ŀ��ϸ��Ϊ���ڿɴ�ɵ�СĿ�꣬ȷ��Ŀ��Ŀɲ����Ժ���ʵ���ԡ�\nά��3����Ԥ��ʩѡ�� - ���������ߵ������ƫ�ã�ѡ����ʵ�������Ԥ��ʩ������֪��Ϊ���ơ���������ѧ���ơ�����������Ƶȡ�\n 2���´λ�̸Ŀ�꣺������ѯ���ݣ���ȡ��ѯʦ������������ѯ�д��һ�£�˫����ͬԸ��Ŭ���ĺ��Ļ�̸Ŀ�ꡣ1-3�㡣\n ά��1���ع������� - �ع˱��λ�̸�Ĺؼ��㣬���������ߵķ�����ǿ���������ˡ�\nά��2��δ�����������̽�� - ��Ա�����ѯ��δ��ȫ�����������³��ֵ����⣬���и������̽�ֺͷ�����\n ά��3��������ϰ��Ӧ�� - �����������ض���Ӧ�Լ��ɻ��������ʼ��ܣ����������ճ������е�ʵ��Ӧ�á�\n �������ڸ���¼������������������������ܽ�'
|
| 349 |
}
|
| 350 |
],
|
| 351 |
stream=True
|
|
|
|
| 360 |
|
| 361 |
def predict_highlight(password_input, user_in_file):
|
| 362 |
if password_input != os.environ.get("USER_KEY"):
|
| 363 |
+
return [(None, "Wrong password!")]
|
| 364 |
file = client.files.create(file=Path(user_in_file), purpose="file-extract")
|
| 365 |
completion = client.chat.completions.create(
|
| 366 |
model="qwen-long",
|
|
|
|
| 408 |
mindmap_button = gr.Button("Mindmap")
|
| 409 |
keywords_button = gr.Button("Keywords")
|
| 410 |
dynamics_button = gr.Button("Dynamics")
|
| 411 |
+
complaint_button = gr.Button("Main Demands")
|
| 412 |
concept_button = gr.Button("Case Conceptualization")
|
| 413 |
highlight_button = gr.Button("Highlights")
|
| 414 |
plan_button = gr.Button("Follow-up Plan")
|