traversaal-ai commited on
Commit
f8712de
·
verified ·
1 Parent(s): cfdc8df

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -2
app.py CHANGED
@@ -30,11 +30,15 @@ def get_youtube_transcript(video_id: str) -> str:
30
  )
31
 
32
  # Combine results into a single string for Gradio output
 
 
33
  output = (
34
  "Full Transcript:\n"
35
  f"{full_transcript_text}\n\n"
36
  "Detailed Transcript Segments:\n"
37
- f"{'\\n'.join(detailed_segments)}")
 
 
38
  return output
39
 
40
  except Exception as e:
@@ -65,4 +69,4 @@ iface = gr.Interface(
65
 
66
  # Launch the Gradio app
67
  if __name__ == "__main__":
68
- iface.launch()
 
30
  )
31
 
32
  # Combine results into a single string for Gradio output
33
+ # Corrected approach: Join segments first, then format the output string
34
+ detailed_segments_str = "\n".join(detailed_segments)
35
  output = (
36
  "Full Transcript:\n"
37
  f"{full_transcript_text}\n\n"
38
  "Detailed Transcript Segments:\n"
39
+ f"{detailed_segments_str}"
40
+ )
41
+
42
  return output
43
 
44
  except Exception as e:
 
69
 
70
  # Launch the Gradio app
71
  if __name__ == "__main__":
72
+ iface.launch()