dtkne commited on
Commit
f430f55
Β·
verified Β·
1 Parent(s): beed497

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +28 -10
app.py CHANGED
@@ -44,29 +44,47 @@ def answer_question(question):
44
  result = qa_pipeline(question=question, context=stored_transcript)
45
  return result['answer']
46
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  # Gradio UI
48
- with gr.Blocks(theme=gr.themes.Base()) as iface:
49
- gr.Markdown("## πŸŽ₯ Video Transcriber, Summarizer & Q&A Tool")
50
- gr.Markdown("Upload a video to get a transcript, summary, and ask questions about its content.")
51
 
52
- with gr.Tab("1️⃣ Transcription & Summary"):
53
  with gr.Row():
54
- video_input = gr.Video(label="πŸ“‚ Upload Video (.mp4)", interactive=True)
55
  with gr.Row():
56
  transcribe_btn = gr.Button("πŸš€ Transcribe and Summarize")
57
  with gr.Row():
58
- transcribed_text = gr.Textbox(label="πŸ“ Transcribed Text", lines=8, interactive=False)
59
- summarized_text = gr.Textbox(label="πŸ“„ Summarized Text", lines=8, interactive=False)
60
 
61
  transcribe_btn.click(fn=transcribe_and_summarize, inputs=video_input, outputs=[transcribed_text, summarized_text])
62
 
63
- with gr.Tab("2️⃣ Ask Questions"):
64
  with gr.Row():
65
- question_input = gr.Textbox(label="❓ Ask a question based on the transcript", placeholder="E.g., What is the main topic?")
66
  with gr.Row():
67
  ask_btn = gr.Button("πŸ” Get Answer")
68
  with gr.Row():
69
- answer_output = gr.Textbox(label="πŸ’¬ Answer", interactive=False)
70
 
71
  ask_btn.click(fn=answer_question, inputs=question_input, outputs=answer_output)
72
 
 
44
  result = qa_pipeline(question=question, context=stored_transcript)
45
  return result['answer']
46
 
47
+ # Custom neon yellow and black theme
48
+ neon_theme = gr.themes.Base(
49
+ primary_hue="yellow",
50
+ secondary_hue="yellow"
51
+ ).set(
52
+ body_background="#000000",
53
+ body_text_color="#FFFF33", # Neon yellow
54
+ button_primary_background="#FFFF33",
55
+ button_primary_text_color="#000000",
56
+ button_secondary_background="#222222",
57
+ button_secondary_text_color="#FFFF33",
58
+ input_background="#111111",
59
+ input_border_color="#FFFF33",
60
+ input_text_color="#FFFF33",
61
+ block_border_color="#FFFF33",
62
+ block_background="#000000"
63
+ )
64
+
65
  # Gradio UI
66
+ with gr.Blocks(theme=neon_theme) as iface:
67
+ gr.Markdown("## πŸŽ₯ <span style='color:#FFFF33'>Video Transcriber, Summarizer & Q&A Tool</span>", unsafe_allow_html=True)
68
+ gr.Markdown("<span style='color:#CCCC33'>Upload a video to get a transcript, summary, and ask questions about its content.</span>", unsafe_allow_html=True)
69
 
70
+ with gr.Tab("πŸ“ Transcription & Summary"):
71
  with gr.Row():
72
+ video_input = gr.Video(label="Upload Video (.mp4)", interactive=True)
73
  with gr.Row():
74
  transcribe_btn = gr.Button("πŸš€ Transcribe and Summarize")
75
  with gr.Row():
76
+ transcribed_text = gr.Textbox(label="Transcribed Text", lines=8, interactive=False)
77
+ summarized_text = gr.Textbox(label="Summarized Text", lines=8, interactive=False)
78
 
79
  transcribe_btn.click(fn=transcribe_and_summarize, inputs=video_input, outputs=[transcribed_text, summarized_text])
80
 
81
+ with gr.Tab("❓ Ask Questions"):
82
  with gr.Row():
83
+ question_input = gr.Textbox(label="Ask a question based on the transcript", placeholder="E.g., What is the main topic?")
84
  with gr.Row():
85
  ask_btn = gr.Button("πŸ” Get Answer")
86
  with gr.Row():
87
+ answer_output = gr.Textbox(label="Answer", interactive=False)
88
 
89
  ask_btn.click(fn=answer_question, inputs=question_input, outputs=answer_output)
90