AngelinaZanardi commited on
Commit
420784b
·
verified ·
1 Parent(s): 25461d9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -20,7 +20,7 @@ import yt_dlp # Added import for yt-dlp
20
  MODEL_NAME = "NbAiLab/nb-whisper-large"
21
  lang = "no"
22
 
23
- logo_path = os.path.join(os.path.dirname(__file__), "Logo_2.png")
24
 
25
  max_audio_length= 30 * 60
26
 
@@ -49,9 +49,9 @@ def pipe(file, return_timestamps=False):
49
 
50
  def format_output(text):
51
  # Add a line break after ".", "!", ":", or "?" unless part of sequences like "..."
52
- text = re.sub(r'(?<!\.)[.!:?](?!\.)', lambda m: m.group() + '<br>', text)
53
  # Ensure line break after sequences like "..." or other punctuation patterns
54
- text = re.sub(r'(\.{3,}|[.!:?])', lambda m: m.group() + '<br><br>', text)
55
  return text
56
 
57
  def transcribe(file, return_timestamps=False):
@@ -129,8 +129,8 @@ def yt_transcribe(yt_url, return_timestamps=False):
129
  demo = gr.Blocks()
130
 
131
  with demo:
132
- with gr.Row():
133
- gr.HTML("<img src='file/Logo_2.png'>")
134
  with gr.Column(scale=8):
135
  # Use Markdown for title and description
136
  gr.Markdown(
 
20
  MODEL_NAME = "NbAiLab/nb-whisper-large"
21
  lang = "no"
22
 
23
+ logo_path = os.path.join(os.path.dirname(__file__), "Logo.png")
24
 
25
  max_audio_length= 30 * 60
26
 
 
49
 
50
  def format_output(text):
51
  # Add a line break after ".", "!", ":", or "?" unless part of sequences like "..."
52
+ #text = re.sub(r'(?<!\.)[.!:?](?!\.)', lambda m: m.group() + '<br>', text)
53
  # Ensure line break after sequences like "..." or other punctuation patterns
54
+ text = re.sub(r'(\.{3,}|[.!:?])', lambda m: m.group() + '<br>', text)
55
  return text
56
 
57
  def transcribe(file, return_timestamps=False):
 
129
  demo = gr.Blocks()
130
 
131
  with demo:
132
+ with gr.Column():
133
+ gr.HTML("<img src='file/Logo.png'>")
134
  with gr.Column(scale=8):
135
  # Use Markdown for title and description
136
  gr.Markdown(