lcjln commited on
Commit
df8b5ec
Β·
verified Β·
1 Parent(s): d20cd0c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -8
app.py CHANGED
@@ -6,6 +6,14 @@ import librosa
6
  import srt
7
  from datetime import timedelta
8
 
 
 
 
 
 
 
 
 
9
  # λͺ¨λΈ 및 ν”„λ‘œμ„Έμ„œ λ‘œλ“œ
10
  @st.cache_resource
11
  def load_model():
@@ -91,11 +99,4 @@ if uploaded_files:
91
 
92
  # μ΅œμ’… SRT 파일 λ‹€μš΄λ‘œλ“œ λ²„νŠΌ
93
  with open(final_srt_file_path, "rb") as srt_file:
94
- st.download_button(label="SRT 파일 λ‹€μš΄λ‘œλ“œ", data=srt_file, file_name=final_srt_file_path, mime="text/srt")
95
-
96
- def split_audio(audio, sr, segment_duration=5):
97
- segments = []
98
- for i in range(0, len(audio), int(segment_duration * sr)):
99
- segment = audio[i:i + int(segment_duration * sr)]
100
- segments.append(segment)
101
- return segments
 
6
  import srt
7
  from datetime import timedelta
8
 
9
+ # μ˜€λ””μ˜€ νŒŒμΌμ„ 5초 κ°„κ²©μœΌλ‘œ λ‚˜λˆ„λŠ” ν•¨μˆ˜
10
+ def split_audio(audio, sr, segment_duration=5):
11
+ segments = []
12
+ for i in range(0, len(audio), int(segment_duration * sr)):
13
+ segment = audio[i:i + int(segment_duration * sr)]
14
+ segments.append(segment)
15
+ return segments
16
+
17
  # λͺ¨λΈ 및 ν”„λ‘œμ„Έμ„œ λ‘œλ“œ
18
  @st.cache_resource
19
  def load_model():
 
99
 
100
  # μ΅œμ’… SRT 파일 λ‹€μš΄λ‘œλ“œ λ²„νŠΌ
101
  with open(final_srt_file_path, "rb") as srt_file:
102
+ st.download_button(label="SRT 파일 λ‹€μš΄λ‘œλ“œ", data=srt_file, file_name=final_srt_file_path, mime="text/srt")