AllenYkl commited on
Commit
32b0ef9
·
1 Parent(s): e03207e

Update bin_public/app/local.py

Browse files
Files changed (1) hide show
  1. bin_public/app/local.py +3 -2
bin_public/app/local.py CHANGED
@@ -28,11 +28,12 @@ def get_file(choice):
28
  fs = HfFileSystem()
29
  with fs.open(f"spaces/AllenYkl/baikejiankang/{choice}") as f:
30
  data = f.read().decode()
31
- return data
32
 
33
  def info_context(file_list_m):
34
  print('Start sampling')
35
- context = f'已知信息{get_file(randomly(file_list_m))}根据已知信息,生成服从以下格式的患者信息,且尽量精简。\n皮肤病类型:\n患者性别:\n患者年龄:\n病史:\n大致症状:'
 
36
  print('sampling finished')
37
  return context
38
 
 
28
  fs = HfFileSystem()
29
  with fs.open(f"spaces/AllenYkl/baikejiankang/{choice}") as f:
30
  data = f.read().decode()
31
+ return data, choice[:-4]
32
 
33
  def info_context(file_list_m):
34
  print('Start sampling')
35
+ doc, disease = get_file(randomly(file_list_m))
36
+ context = f"以下是 {disease} 的常见症状:{doc}\n\n请根据上文内容,生成一位 {disease} 患者的信息,服从以下格式:\n患者性别:\n患者年龄:\n病史:\n症状:"
37
  print('sampling finished')
38
  return context
39