Create app.py
Browse files1234567891011121314151617181920212223242526272829303132333435# importsimport gradio as grimport requestsimport json
# functionsdef check(v1, v2): if not v1 or not v2: raise gr.Error("Выберите все ответы!") return None if v1 == 'А': v1 = "✔" if v2 == 'Б': v2 = "✔"
return f"{v1} - {v2}"# csscss = """footer {visibility: hidden !important;}"""
# uiwith gr.Blocks(css=css, theme='YTheme/TehnoX') as vui: with gr.Row(): v1 = gr.Radio(label="Вопрос 1", info="Выберите А", choices=["А", "Б", "В"]) v2 = gr.Radio(label="Вопрос 2", info="Выберите Б", choices=["А", "Б", "В"]) text_button = gr.Button("Проверить", variant='primary') with gr.Tab("Результаты"): text_output = gr.Markdown("") text_button.click(check, inputs=[promt, model, max_tokens], outputs=[text_output, text_output_nm])
#endvui.queue(api_open=False).launch()app.pyAdded+35