|
import gradio as gr |
|
import random |
|
|
|
|
|
def generate_questions(video_url): |
|
questions = [] |
|
for i in range(10): |
|
questions.append(f"ๅ้ก {i+1} ๅ็น้ๅๅฝฑ็๏ผ{video_url}๏ผ็ๆๅ้่ฆ้ป") |
|
return questions |
|
|
|
|
|
def interface(): |
|
with gr.Blocks() as demo: |
|
gr.Markdown("## ๅฝฑ็็ฟ้ก็ข็ๅจ") |
|
|
|
|
|
video_url = gr.Textbox(label="ๅฝฑ็้ฃ็ต") |
|
|
|
|
|
generate_btn = gr.Button("็ๆ้ก็ฎ") |
|
|
|
|
|
questions_output = gr.Textbox(label="็ๆ็้ก็ฎ", lines=10) |
|
|
|
|
|
generate_btn.click(fn=generate_questions, inputs=video_url, outputs=questions_output) |
|
|
|
return demo |
|
|
|
|
|
demo = interface() |
|
demo.launch() |
|
|