Spaces:
Runtime error
Runtime error
Commit
·
4c94d57
1
Parent(s):
508e4e1
Chore: Modify button text and theme
Browse files
README.md
CHANGED
|
@@ -10,4 +10,5 @@ pinned: false
|
|
| 10 |
license: cc-by-4.0
|
| 11 |
---
|
| 12 |
|
|
|
|
| 13 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 10 |
license: cc-by-4.0
|
| 11 |
---
|
| 12 |
|
| 13 |
+
|
| 14 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
app.py
CHANGED
|
@@ -4,6 +4,16 @@ import spaces
|
|
| 4 |
import torchaudio
|
| 5 |
from nemo.collections.speechlm2 import SALM
|
| 6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
# Set device to use cuda if available and sample rate to 16000 for Nvidia NeMo
|
| 8 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 9 |
SAMPLE_RATE = 16000
|
|
@@ -62,7 +72,7 @@ def answer_question(transcript, question):
|
|
| 62 |
return answer.strip()
|
| 63 |
|
| 64 |
# Build the Gradio interface
|
| 65 |
-
with gr.Blocks(
|
| 66 |
gr.Markdown("# Canary-Qwen Transcriber with Q&A")
|
| 67 |
gr.Markdown("Upload or record audio to transcribe, then ask questions about it.")
|
| 68 |
|
|
@@ -80,8 +90,8 @@ with gr.Blocks(title="Canary-Qwen Transcriber & Q&A") as demo:
|
|
| 80 |
with gr.Row():
|
| 81 |
with gr.Column():
|
| 82 |
question_input = gr.Textbox(label="Ask a question about the transcript", placeholder="What is the main topic?")
|
| 83 |
-
ask_btn = gr.Button("Ask", variant="primary")
|
| 84 |
-
|
| 85 |
with gr.Column():
|
| 86 |
answer_output = gr.Textbox(label="Answer", lines=4)
|
| 87 |
|
|
|
|
| 4 |
import torchaudio
|
| 5 |
from nemo.collections.speechlm2 import SALM
|
| 6 |
|
| 7 |
+
# Set synthwave theme
|
| 8 |
+
theme = gr.themes.Ocean(
|
| 9 |
+
primary_hue="indigo",
|
| 10 |
+
secondary_hue="fuchsia",
|
| 11 |
+
neutral_hue="slate",
|
| 12 |
+
).set(
|
| 13 |
+
button_large_radius='*radius_sm'
|
| 14 |
+
)
|
| 15 |
+
|
| 16 |
+
|
| 17 |
# Set device to use cuda if available and sample rate to 16000 for Nvidia NeMo
|
| 18 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
| 19 |
SAMPLE_RATE = 16000
|
|
|
|
| 72 |
return answer.strip()
|
| 73 |
|
| 74 |
# Build the Gradio interface
|
| 75 |
+
with gr.Blocks(theme=theme) as demo:
|
| 76 |
gr.Markdown("# Canary-Qwen Transcriber with Q&A")
|
| 77 |
gr.Markdown("Upload or record audio to transcribe, then ask questions about it.")
|
| 78 |
|
|
|
|
| 90 |
with gr.Row():
|
| 91 |
with gr.Column():
|
| 92 |
question_input = gr.Textbox(label="Ask a question about the transcript", placeholder="What is the main topic?")
|
| 93 |
+
ask_btn = gr.Button("Ask About Transcript", variant="primary")
|
| 94 |
+
|
| 95 |
with gr.Column():
|
| 96 |
answer_output = gr.Textbox(label="Answer", lines=4)
|
| 97 |
|