tayyardurden commited on
Commit
6b69d5b
·
verified ·
1 Parent(s): 4ed9614

Upload app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -8
app.py CHANGED
@@ -4,27 +4,23 @@ import streamlit as st
4
  import time
5
 
6
 
7
-
8
-
9
-
10
-
11
  st.header("Bas Konuş")
12
  sentence = st.text_input("Konuşmak istediğiniz metni girin")
13
  speaker=st.button("Konuş")
14
 
15
 
16
  if speaker:
17
- start_time = time.time() # Start the timer
18
  speaker_wav ="sounds/alp.mp3"
19
  device = "cpu"
20
  tts = TTS("tts_models/multilingual/multi-dataset/xtts_v2").to(device)
21
 
22
- output_path = tts.tts_to_file(text=sentence, speaker_wav=speaker_wav ,language="tr")
23
 
 
 
24
  end_time = time.time() # End the timer
25
- execution_time = end_time - start_time # Calculate the time taken
26
 
27
- st.write(f"Execution time: {execution_time} seconds") # Display the time taken
 
28
 
29
  st.audio(output_path, format="audio/mp3")
30
 
 
4
  import time
5
 
6
 
 
 
 
 
7
  st.header("Bas Konuş")
8
  sentence = st.text_input("Konuşmak istediğiniz metni girin")
9
  speaker=st.button("Konuş")
10
 
11
 
12
  if speaker:
 
13
  speaker_wav ="sounds/alp.mp3"
14
  device = "cpu"
15
  tts = TTS("tts_models/multilingual/multi-dataset/xtts_v2").to(device)
16
 
 
17
 
18
+ start_time = time.time() # Start the timer
19
+ output_path = tts.tts_to_file(text=sentence, speaker_wav=speaker_wav ,language="tr")
20
  end_time = time.time() # End the timer
 
21
 
22
+ execution_time = round(end_time - start_time,2) # Calculate the time taken
23
+ st.write(f"Tamamlanma süresi: {execution_time} saniye") # Display the time taken
24
 
25
  st.audio(output_path, format="audio/mp3")
26