abdullahmubeen10 commited on
Commit
bec2abe
Β·
verified Β·
1 Parent(s): 1cd56d0

Update Demo.py

Browse files
Files changed (1) hide show
  1. Demo.py +3 -4
Demo.py CHANGED
@@ -119,7 +119,7 @@ st.sidebar.markdown("""
119
  """, unsafe_allow_html=True)
120
 
121
  # Load examples
122
- AUDIO_FILE_PATH = "inputs"
123
  audio_files = sorted(os.listdir(AUDIO_FILE_PATH))
124
 
125
  selected_audio = st.selectbox("Select an audio", audio_files)
@@ -141,10 +141,9 @@ with open(selected_audio, 'rb') as audio_file:
141
  audio_bytes = audio_file.read()
142
  st.audio(audio_bytes)
143
 
144
- st.subheader(f"Transcription for {selected_audio}:")
145
-
146
  spark = init_spark()
147
  pipeline = create_pipeline(model)
148
  output = fit_data(pipeline, selected_audio)
149
 
150
- st.text(output.first().result[0].strip())
 
 
119
  """, unsafe_allow_html=True)
120
 
121
  # Load examples
122
+ AUDIO_FILE_PATH = "/content/Wav2Vec2ForCTC/inputs"
123
  audio_files = sorted(os.listdir(AUDIO_FILE_PATH))
124
 
125
  selected_audio = st.selectbox("Select an audio", audio_files)
 
141
  audio_bytes = audio_file.read()
142
  st.audio(audio_bytes)
143
 
 
 
144
  spark = init_spark()
145
  pipeline = create_pipeline(model)
146
  output = fit_data(pipeline, selected_audio)
147
 
148
+ st.subheader(f"Transcription:")
149
+ st.markdown(f"**{output.first().result[0].strip()}**")