Spaces:
Runtime error
Runtime error
🎨 improve formatting
Browse filesSigned-off-by: peter szemraj <[email protected]>
utils.py
CHANGED
|
@@ -104,10 +104,10 @@ def saves_summary(
|
|
| 104 |
if outpath is None
|
| 105 |
else Path(outpath)
|
| 106 |
)
|
| 107 |
-
sum_text = [s[
|
| 108 |
sum_scores = [f"\n - {round(s['summary_score'],4)}" for s in summarize_output]
|
| 109 |
scores_text = "\n".join(sum_scores)
|
| 110 |
-
full_summary = "\n
|
| 111 |
|
| 112 |
with open(
|
| 113 |
outpath,
|
|
@@ -124,14 +124,14 @@ def saves_summary(
|
|
| 124 |
outpath,
|
| 125 |
"a",
|
| 126 |
) as fo:
|
| 127 |
-
fo.write("\n"
|
| 128 |
fo.write(f"## Section Scores:\n\n")
|
| 129 |
fo.writelines(scores_text)
|
| 130 |
fo.write("\n\n")
|
| 131 |
fo.write(f"Date: {get_timestamp()}\n\n")
|
| 132 |
if kwargs:
|
| 133 |
fo.write("---\n\n")
|
| 134 |
-
fo.write("Parameters:\n\n")
|
| 135 |
for key, value in kwargs.items():
|
| 136 |
fo.write(f"{key}: {value}\n")
|
| 137 |
return outpath
|
|
|
|
| 104 |
if outpath is None
|
| 105 |
else Path(outpath)
|
| 106 |
)
|
| 107 |
+
sum_text = [f"\t{s['summary'][0]}\n" for s in summarize_output]
|
| 108 |
sum_scores = [f"\n - {round(s['summary_score'],4)}" for s in summarize_output]
|
| 109 |
scores_text = "\n".join(sum_scores)
|
| 110 |
+
full_summary = "\n".join(sum_text)
|
| 111 |
|
| 112 |
with open(
|
| 113 |
outpath,
|
|
|
|
| 124 |
outpath,
|
| 125 |
"a",
|
| 126 |
) as fo:
|
| 127 |
+
fo.write("\n")
|
| 128 |
fo.write(f"## Section Scores:\n\n")
|
| 129 |
fo.writelines(scores_text)
|
| 130 |
fo.write("\n\n")
|
| 131 |
fo.write(f"Date: {get_timestamp()}\n\n")
|
| 132 |
if kwargs:
|
| 133 |
fo.write("---\n\n")
|
| 134 |
+
fo.write("## Parameters:\n\n")
|
| 135 |
for key, value in kwargs.items():
|
| 136 |
fo.write(f"{key}: {value}\n")
|
| 137 |
return outpath
|