tykiww commited on
Commit
adafc31
β€’
1 Parent(s): 8f92dc6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -6
app.py CHANGED
@@ -60,9 +60,10 @@ def tempfile_generator():
60
  return temp_file_name
61
 
62
 
63
- def substitute_names(speaker_names, text):
64
  # Clean Speaker names
65
  df = speaker_names.itertuples(index=False)
 
66
  for default, name, title in df:
67
  if title != "":
68
  title = " ("+title.strip()+")"
@@ -73,7 +74,6 @@ def substitute_names(speaker_names, text):
73
  with open(temp_file_name, "w") as file:
74
  file.write(text)
75
 
76
- return temp_file_name
77
 
78
  def main(conf):
79
 
@@ -95,11 +95,11 @@ def main(conf):
95
  value=conf["session"]["min_speakers"])
96
 
97
  process_button = gr.Button("Process")
98
- output_box = gr.Textbox("Progress")
99
 
100
 
101
  with gr.TabItem(conf["layout"]["page_names"][2]):
102
- gr.Markdown("# πŸ”Š View and download your meeting transcript")
103
  transcription_output = gr.Textbox(label="Transcription Review")
104
 
105
  speaker_names = gr.Dataframe(
@@ -112,7 +112,7 @@ def main(conf):
112
  value=default_table(),
113
  )
114
  fix_button = gr.Button("Fix and Prepare Download")
115
- label_file_link = gr.File(label="Download Cleaned Transcription")
116
 
117
  # Process
118
  process_button.click(fn=click_message,
@@ -126,7 +126,7 @@ def main(conf):
126
 
127
  fix_button.click(
128
  fn=substitute_names,
129
- inputs=[speaker_names, transcription_output],
130
  outputs=[label_file_link]
131
  )
132
 
 
60
  return temp_file_name
61
 
62
 
63
+ def substitute_names(speaker_names, num_speakers, text):
64
  # Clean Speaker names
65
  df = speaker_names.itertuples(index=False)
66
+ df = df[0:(num_speakers-1)]
67
  for default, name, title in df:
68
  if title != "":
69
  title = " ("+title.strip()+")"
 
74
  with open(temp_file_name, "w") as file:
75
  file.write(text)
76
 
 
77
 
78
  def main(conf):
79
 
 
95
  value=conf["session"]["min_speakers"])
96
 
97
  process_button = gr.Button("Process")
98
+ output_box = gr.Textbox(label="Progress")
99
 
100
 
101
  with gr.TabItem(conf["layout"]["page_names"][2]):
102
+ gr.Markdown("# πŸ“„ View and download your meeting transcript")
103
  transcription_output = gr.Textbox(label="Transcription Review")
104
 
105
  speaker_names = gr.Dataframe(
 
112
  value=default_table(),
113
  )
114
  fix_button = gr.Button("Fix and Prepare Download")
115
+ label_file_link = gr.File(label="Download Cleaned Transcript")
116
 
117
  # Process
118
  process_button.click(fn=click_message,
 
126
 
127
  fix_button.click(
128
  fn=substitute_names,
129
+ inputs=[speaker_names, num_speakers, transcription_output],
130
  outputs=[label_file_link]
131
  )
132