Spaces:
Runtime error
Runtime error
feat: simplification of UI
Browse files239 unmodified lines24024124224324424524624724824925025140 unmodified lines2922932942952962972982993003013023033043053063073086 unmodified lines315316317318319320321322323324239 unmodified linesplaceholder="...Type something here",rtl=True,)chat_interface = gr.ChatInterface(generate,chatbot=chatbot,textbox=textbox,#examples=examples,additional_inputs=additional_inputs,cache_examples=False,)40 unmodified lines]jsonlfile.write("\n".join(json_data) + "\n")def hello(profile: gr.OAuthProfile | None) -> str:global USERNAMEglobal NAME#print(dir(profile))if profile is None:USERNAME = "guest"NAME = "guest"return "I don't know you. Please login:"NAME = profile.nameUSERNAME = profile.preferred_usernamereturn f"Hello {profile.name}"with gr.Blocks(css=CSS) as demo:6 unmodified lines)with gr.Row():with gr.Column():gr.Markdown().attach_load_event(hello, None)with gr.Row():with gr.Column():gr.LoginButton()#gr.LogoutButton()chatbot.like(vote, None, None)239 unmodified lines24024124224324424524624724824925025125225325425525625725825926026126226326426526640 unmodified lines3073083093103113123133143153163173183193203213223233243253263273283293303313323333346 unmodified lines341342343344345346347348349350351352353239 unmodified linesplaceholder="...Type something here",rtl=True,)textbox_whoareu = gr.Textbox(label="textbox_whoareu",container=False,show_label=False,lines=1,placeholder="Who are you?",rtl=False,)chat_interface = gr.ChatInterface(generate,chatbot=chatbot,textbox=textbox,#examples=examples,additional_inputs=additional_inputs,submit_btn = "Generate",stop_btn = None,retry_btn = None,undo_btn = None,clear_btn = None,cache_examples=False,)40 unmodified lines]jsonlfile.write("\n".join(json_data) + "\n")def save_whotheyare(x):global USERNAMEglobal NAMEif len(x) == 0:USERNAME = "guest"NAME = "guest"else:USERNAME = ""NAME = x# def hello(profile: gr.OAuthProfile | None) -> str:# global USERNAME# global NAME# #print(dir(profile))# if profile is None:# USERNAME = "guest"# NAME = "guest"# return "I don't know you. Please login:"# NAME = profile.name# USERNAME = profile.preferred_username# return f"Hello {profile.name}"with gr.Blocks(css=CSS) as demo:6 unmodified lines)with gr.Row():with gr.Column():textbox_whoareu.render()textbox_whoareu.change(fn=save_whotheyare, inputs=textbox_whoareu, outputs=None,show_progress = False, status_tracker = None)# gr.Markdown().attach_load_event(hello, None)# with gr.Row():# with gr.Column():# gr.LoginButton()#gr.LogoutButton()chatbot.like(vote, None, None)
app.py+40-11