Phaneendrabayi commited on
Commit
a8f62b7
·
verified ·
1 Parent(s): 4739e8c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -7
app.py CHANGED
@@ -90,8 +90,15 @@ if uploaded_file:
90
  st.subheader("Generated Subtitles:")
91
  st.write(transcribed_text)
92
 
93
- search_word = st.text_input("Search for a word in subtitles")
94
- if search_word:
 
 
 
 
 
 
 
95
  search_result = search_word_in_subtitles(search_word, transcribed_text)
96
  st.subheader("Word Search Results:")
97
  st.write(search_result)
@@ -101,9 +108,5 @@ if uploaded_file:
101
  st.write(f"Similarity Score: {similarity_score:.2f}")
102
  st.write(best_match)
103
 
104
- # Download Subtitles Without Refresh
105
- st.download_button("Download Subtitles (SRT)", transcribed_text, file_name="subtitles.srt", mime="text/plain", key="srt_download", on_click=lambda: None)
106
- st.download_button("Download Subtitles (Plain Text)", plain_text, file_name="subtitles.txt", mime="text/plain", key="text_download", on_click=lambda: None)
107
-
108
  os.remove(temp_audio_path)
109
- st.success("Process completed successfully!")
 
90
  st.subheader("Generated Subtitles:")
91
  st.write(transcribed_text)
92
 
93
+ # Columns for download options
94
+ col1, col2 = st.columns(2)
95
+ with col1:
96
+ st.download_button("Download Subtitles (SRT)", transcribed_text, file_name="subtitles.srt", mime="text/plain", key="srt_download", on_click=lambda: None)
97
+ with col2:
98
+ st.download_button("Download Subtitles (Plain Text)", plain_text, file_name="subtitles.txt", mime="text/plain", key="text_download", on_click=lambda: None)
99
+
100
+ search_word = st.text_input("Search for a word in subtitles (Optional)")
101
+ if search_word.strip():
102
  search_result = search_word_in_subtitles(search_word, transcribed_text)
103
  st.subheader("Word Search Results:")
104
  st.write(search_result)
 
108
  st.write(f"Similarity Score: {similarity_score:.2f}")
109
  st.write(best_match)
110
 
 
 
 
 
111
  os.remove(temp_audio_path)
112
+ st.success("Process completed successfully!")