Peter commited on
Commit
ecba037
1 Parent(s): b3e95f6

section sequencing

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -93,13 +93,13 @@ def proc_submission(
93
  batch_length=token_batch_length,
94
  **settings,
95
  )
96
- sum_text = [s["summary"][0] for s in _summaries]
97
  sum_scores = [
98
  f"\n - Section {i}: {round(s['summary_score'],4)}"
99
  for i, s in enumerate(_summaries)
100
  ]
101
 
102
- history["Summary Text"] = "\n\t".join(sum_text)
103
  history["Summary Scores"] = "\n".join(sum_scores)
104
  history["Input"] = tr_in
105
  html = ""
@@ -125,7 +125,7 @@ def load_examples(examples_dir="examples"):
125
  for example in examples:
126
  with open(example, "r") as f:
127
  text = f.read()
128
- text_examples.append([text, "base", 2, 1024, 0.7, 3.5, 3])
129
 
130
  return text_examples
131
 
@@ -153,10 +153,10 @@ if __name__ == "__main__":
153
  ),
154
  gr.inputs.Slider(
155
  minimum=512,
156
- maximum=2048,
157
  label="token_batch_length",
158
- default=1024,
159
- step=512,
160
  ),
161
  gr.inputs.Slider(
162
  minimum=0.5, maximum=1.1, label="length_penalty", default=0.7, step=0.05
 
93
  batch_length=token_batch_length,
94
  **settings,
95
  )
96
+ sum_text = [f"Section {i}: " + s["summary"][0] for i, s in enumerate(_summaries)]
97
  sum_scores = [
98
  f"\n - Section {i}: {round(s['summary_score'],4)}"
99
  for i, s in enumerate(_summaries)
100
  ]
101
 
102
+ history["Summary Text"] = "<br>".join(sum_text)
103
  history["Summary Scores"] = "\n".join(sum_scores)
104
  history["Input"] = tr_in
105
  html = ""
 
125
  for example in examples:
126
  with open(example, "r") as f:
127
  text = f.read()
128
+ text_examples.append([text, "base", 4, 512, 0.7, 3.5, 3])
129
 
130
  return text_examples
131
 
 
153
  ),
154
  gr.inputs.Slider(
155
  minimum=512,
156
+ maximum=1024,
157
  label="token_batch_length",
158
+ default=512,
159
+ step=256,
160
  ),
161
  gr.inputs.Slider(
162
  minimum=0.5, maximum=1.1, label="length_penalty", default=0.7, step=0.05