Spaces:
Sleeping
Sleeping
Ziad Meligy commited on
Commit ·
33e322c
1
Parent(s): 34332a8
adding apicall
Browse files
api.py
CHANGED
|
@@ -15,7 +15,7 @@ def API_call(report):
|
|
| 15 |
body = {
|
| 16 |
"messages": [
|
| 17 |
{"role": "system", "content": ""},
|
| 18 |
-
{"role": "user", "content": f"please structure this report into findings and impressions. Please be precise and just output the findings and impressions with no other text.{report}"}
|
| 19 |
],
|
| 20 |
"temperature": 1,
|
| 21 |
"top_p": 1,
|
|
|
|
| 15 |
body = {
|
| 16 |
"messages": [
|
| 17 |
{"role": "system", "content": ""},
|
| 18 |
+
{"role": "user", "content": f"please structure this report into findings and impressions. Please be precise and just output the findings and impressions with no other text.Please keep the same length of the original report. Report:{report}"}
|
| 19 |
],
|
| 20 |
"temperature": 1,
|
| 21 |
"top_p": 1,
|
utils.py
CHANGED
|
@@ -24,6 +24,8 @@ def split_report_sections(report_text):
|
|
| 24 |
impression = impression_match.group(1).strip() if impression_match else ""
|
| 25 |
|
| 26 |
findings = clean_paragraph(findings_raw)
|
|
|
|
|
|
|
| 27 |
|
| 28 |
return {
|
| 29 |
"findings": findings,
|
|
|
|
| 24 |
impression = impression_match.group(1).strip() if impression_match else ""
|
| 25 |
|
| 26 |
findings = clean_paragraph(findings_raw)
|
| 27 |
+
impression = clean_paragraph(impression)
|
| 28 |
+
|
| 29 |
|
| 30 |
return {
|
| 31 |
"findings": findings,
|