Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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__), "
|
| 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
|
| 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.
|
| 133 |
-
gr.HTML("<img src='file/
|
| 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(
|