Spaces:
Sleeping
Sleeping
import gradio as gr | |
info_world="hello" | |
story_objective="june" | |
info_rules="none" | |
info_char="carrot" | |
info_charvar="mope" | |
def plex(): | |
return "this is a test, this is a test, this is a test, this is a test, this is a test, this is a test, this is a test, this is a test, this is a test, this is a test, this is a test, this is a test, this is a test, this is a test, this is a test, this is a test, this is a test, this is a test, this is a test, this is a test, ", "this is a test, this is a test, this is a test, this is a test, this is a test, this is a test, this is a test, this is a test, this is a test, this is a test, this is a test, this is a test, this is a test, this is a test, this is a test, this is a test, this is a test, this is a test, this is a test, this is a test, ", "this is a test, this is a test, this is a test, this is a test, this is a test, this is a test, this is a test, this is a test, this is a test, this is a test, this is a test, this is a test, this is a test, this is a test, this is a test, this is a test, this is a test, this is a test, this is a test, this is a test, " | |
with gr.Blocks() as app: | |
with gr.Tabs() as tabs: | |
with gr.Tab("Rather Static", id="A"): | |
world = gr.Textbox(label="World", value=f"{info_world}", interactive=True) | |
rules = gr.Textbox(label="Rules", value=f"{info_rules}", interactive=True) | |
char = gr.Textbox(label="Main Character", value=f"{info_char}", interactive=True) | |
btna=gr.Button("test text") | |
btna.click(fn=plex,inputs=None,outputs=[world,rules,char]) | |
with gr.Tab("Main Work", id="B"): | |
with gr.Row(): | |
with gr.Column(): | |
char_temp = gr.Textbox(label="Character Variables", value=f"{info_charvar}", interactive=True) | |
story_obj = gr.Textbox(label="Story Objectives", value=f"{story_objective}", interactive=True) | |
atest=gr.Textbox(label="extra") | |
with gr.Column(): | |
char_temp_out = gr.Textbox(label="Character Variables", value="", interactive=True) | |
story_obj_out = gr.Textbox(label="Story Objectives", value="", interactive=True) | |
btnb=gr.Button("test text") | |
btnb.click(fn=plex,inputs=None,outputs=[story_obj_out,char_temp_out]) | |
with gr.Tab("Displayable Elements", id="C"): | |
with gr.Row(): | |
with gr.Column(): | |
narration = gr.Textbox(label="Narration", value="", interactive=True) | |
with gr.Column(): | |
npcs_show = gr.Textbox(label="NPCs", value="", interactive=True) | |
items_show = gr.Textbox(label="Items", value="", interactive=True) | |
destinations_show = gr.Textbox(label="Destinations", value="", interactive=True) | |
btnc=gr.Button("test text") | |
btnc.click(fn=plex,inputs=None,outputs=[npcs_show,items_show,destinations_show]) | |
app.launch() |