Spaces:
Runtime error
Runtime error
Update bin_public/app/local.py
Browse files- 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 |
-
|
|
|
|
| 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 |
|