unijoh commited on
Commit
06b50d8
·
verified ·
1 Parent(s): 15741ba

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -13
app.py CHANGED
@@ -2,7 +2,7 @@ import gradio as gr
2
  import time
3
  from transformers import pipeline
4
  import torch
5
- import ffmpeg # Make sure it's ffmpeg-python
6
 
7
  def main():
8
  # Check if GPU is available
@@ -38,7 +38,7 @@ def main():
38
 
39
  if not audio:
40
  # Return a meaningful message; no audio found
41
- return state, "No audio provided for transcription."
42
 
43
  try:
44
  time.sleep(3)
@@ -46,7 +46,7 @@ def main():
46
  state += text + "\n"
47
  return state, text
48
  except Exception as e:
49
- return state, "An error occurred during transcription."
50
 
51
  def reset_output(transcription, state):
52
  """Function to reset the state to an empty string."""
@@ -59,26 +59,22 @@ def main():
59
  with gr.Column():
60
  microphone = gr.Audio(
61
  type="filepath",
62
- label="Microphone Input"
63
- )
64
- uploaded_audio = gr.Audio(
65
- label="Upload Audio File",
66
- type="filepath"
67
  )
68
  m3u8_url = gr.Textbox(
69
- label="m3u8 URL | E.g.: from kvf.fo or logting.fo"
70
  )
71
 
72
  with gr.Column():
73
  transcription_var = gr.Textbox(
74
  type="text",
75
- label="Transcription",
76
- interactive=False # Updated here
77
  )
78
 
79
  with gr.Row():
80
- transcribe_button = gr.Button("Transcribe")
81
- reset_button = gr.Button("Reset output")
82
 
83
  transcribe_button.click(
84
  transcribe_function,
 
2
  import time
3
  from transformers import pipeline
4
  import torch
5
+ import ffmpeg
6
 
7
  def main():
8
  # Check if GPU is available
 
38
 
39
  if not audio:
40
  # Return a meaningful message; no audio found
41
+ return state, "Einki ljóð er til talukenning."
42
 
43
  try:
44
  time.sleep(3)
 
46
  state += text + "\n"
47
  return state, text
48
  except Exception as e:
49
+ return state, "Okkurt riggaði ikki í talukenningini."
50
 
51
  def reset_output(transcription, state):
52
  """Function to reset the state to an empty string."""
 
59
  with gr.Column():
60
  microphone = gr.Audio(
61
  type="filepath",
62
+ label="Mikrofon ella ljóðfíla"
 
 
 
 
63
  )
64
  m3u8_url = gr.Textbox(
65
+ label="m3u8-leinki | T.d. frá kvf.fo or logting.fo"
66
  )
67
 
68
  with gr.Column():
69
  transcription_var = gr.Textbox(
70
  type="text",
71
+ label="Tekstur frá talukennara",
72
+ interactive=False
73
  )
74
 
75
  with gr.Row():
76
+ transcribe_button = gr.Button("Byrja talukenning")
77
+ reset_button = gr.Button("Strika tekst frá talukennara")
78
 
79
  transcribe_button.click(
80
  transcribe_function,