youngtsai commited on
Commit
799a8f8
1 Parent(s): 62b7350

with gr.Blocks(js=JS, css=CSS) as demo:

Browse files
Files changed (1) hide show
  1. app.py +10 -11
app.py CHANGED
@@ -811,20 +811,19 @@ def next_slide():
811
  def get_video_id():
812
  return VIDEO_ID
813
 
814
- HEAD = """
815
- <meta charset="UTF-8">
816
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
817
- <style>
 
818
  svg.markmap {{
819
  width: 100%;
820
  height: 100vh;
821
  }}
822
- </style>
823
- <script src="https://cdn.jsdelivr.net/npm/markmap-autoloader@0.15.2"></script>
824
  """
825
 
826
 
827
- with gr.Blocks(head=HEAD) as demo:
828
  with gr.Row():
829
  with gr.Column():
830
  file_upload = gr.File(label="Upload your CSV or Word file", visible=False)
@@ -836,7 +835,7 @@ with gr.Blocks(head=HEAD) as demo:
836
  send_button = gr.Button("Send")
837
 
838
  with gr.Column():
839
- with gr.Tab("截圖與逐字稿"):
840
  transcript_html = gr.HTML(label="YouTube Transcript and Video")
841
  with gr.Tab("投影片"):
842
  slide_image = gr.Image()
@@ -846,11 +845,11 @@ with gr.Blocks(head=HEAD) as demo:
846
  next_button = gr.Button("Next")
847
  prev_button.click(fn=prev_slide, inputs=[], outputs=[slide_image, slide_text])
848
  next_button.click(fn=next_slide, inputs=[], outputs=[slide_image, slide_text])
849
- with gr.Tab("資料本文"):
850
  df_string_output = gr.Textbox(lines=40, label="Data Text")
851
- with gr.Tab("重點整理"):
852
  df_summarise = gr.Textbox(container=True, show_copy_button=True, lines=40)
853
- with gr.Tab("常用問題"):
854
  gr.Markdown("## 常用問題")
855
  btn_1 = gr.Button()
856
  btn_2 = gr.Button()
 
811
  def get_video_id():
812
  return VIDEO_ID
813
 
814
+ JS = """
815
+ <script src="https://cdn.jsdelivr.net/npm/markmap-autoloader@0.15.2"></script>
816
+ """
817
+
818
+ CSS = """
819
  svg.markmap {{
820
  width: 100%;
821
  height: 100vh;
822
  }}
 
 
823
  """
824
 
825
 
826
+ with gr.Blocks(js=JS, css=CSS) as demo:
827
  with gr.Row():
828
  with gr.Column():
829
  file_upload = gr.File(label="Upload your CSV or Word file", visible=False)
 
835
  send_button = gr.Button("Send")
836
 
837
  with gr.Column():
838
+ with gr.Tab("圖文"):
839
  transcript_html = gr.HTML(label="YouTube Transcript and Video")
840
  with gr.Tab("投影片"):
841
  slide_image = gr.Image()
 
845
  next_button = gr.Button("Next")
846
  prev_button.click(fn=prev_slide, inputs=[], outputs=[slide_image, slide_text])
847
  next_button.click(fn=next_slide, inputs=[], outputs=[slide_image, slide_text])
848
+ with gr.Tab("本文"):
849
  df_string_output = gr.Textbox(lines=40, label="Data Text")
850
+ with gr.Tab("重點"):
851
  df_summarise = gr.Textbox(container=True, show_copy_button=True, lines=40)
852
+ with gr.Tab("問題"):
853
  gr.Markdown("## 常用問題")
854
  btn_1 = gr.Button()
855
  btn_2 = gr.Button()