Spaces:
Running
Running
simplify
Browse files
app.py
CHANGED
@@ -199,6 +199,7 @@ URL_EXAMPLES = [
|
|
199 |
"https://lite.cnn.com/2024/05/13/tech/openai-altman-new-ai-model-gpt-4o/index.html",
|
200 |
]
|
201 |
|
|
|
202 |
|
203 |
with open("README.md", "r") as fin:
|
204 |
info_md = (
|
@@ -213,14 +214,12 @@ with gr.Blocks(
|
|
213 |
) as demo:
|
214 |
gr.Markdown(HEADER)
|
215 |
quiz = gr.State({})
|
216 |
-
examples_to_show = gr.State(random.sample(URL_EXAMPLES, 5))
|
217 |
-
|
218 |
with gr.Tabs() as tabs:
|
219 |
with gr.TabItem("Generate quiz and play"):
|
220 |
with gr.Row():
|
221 |
url = gr.Textbox(
|
222 |
label="URL from which to generate a quiz",
|
223 |
-
value=examples_to_show
|
224 |
interactive=True,
|
225 |
max_lines=1,
|
226 |
)
|
@@ -229,7 +228,7 @@ with gr.Blocks(
|
|
229 |
)
|
230 |
|
231 |
examples = gr.Examples(
|
232 |
-
examples=examples_to_show
|
233 |
inputs=[url],
|
234 |
label=["Example URLs"],
|
235 |
)
|
|
|
199 |
"https://lite.cnn.com/2024/05/13/tech/openai-altman-new-ai-model-gpt-4o/index.html",
|
200 |
]
|
201 |
|
202 |
+
examples_to_show = [URL_EXAMPLES[0]] + random.sample(URL_EXAMPLES[1:], 6)
|
203 |
|
204 |
with open("README.md", "r") as fin:
|
205 |
info_md = (
|
|
|
214 |
) as demo:
|
215 |
gr.Markdown(HEADER)
|
216 |
quiz = gr.State({})
|
|
|
|
|
217 |
with gr.Tabs() as tabs:
|
218 |
with gr.TabItem("Generate quiz and play"):
|
219 |
with gr.Row():
|
220 |
url = gr.Textbox(
|
221 |
label="URL from which to generate a quiz",
|
222 |
+
value=examples_to_show[0],
|
223 |
interactive=True,
|
224 |
max_lines=1,
|
225 |
)
|
|
|
228 |
)
|
229 |
|
230 |
examples = gr.Examples(
|
231 |
+
examples=examples_to_show,
|
232 |
inputs=[url],
|
233 |
label=["Example URLs"],
|
234 |
)
|