Spaces:
Runtime error
Runtime error
feat: adding a textbox
Browse files9 unmodified lines10111213141516171847 unmodified lines6667686970717251 unmodified lines1241251261271281291301311321339 unmodified lines1431441451469 unmodified linesAPI_URL = "https://api-inference.huggingface.co/models/DataAnalyticsLab/PersianGPT-FT-Grover"BOT_NAME = "PersianGPT-FT"STOP_SEQUENCES = [] #["<|endoftext|>",">"]EXAMPLES = [["<$غزل$@بر لبم هر ذره داغی می توان کردن"],["<$غزل$%صائب تبریزی%"],["<$قصاید$"],47 unmodified linesfor response in stream:output += responsefor stop_str in STOP_SEQUENCES:if output.endswith(stop_str):output = output[:-len(stop_str)]output = output.rstrip()51 unmodified lines"""chatbot = gr.Chatbot(bubble_full_width = False)chat_interface = gr.ChatInterface(generate,chatbot=chatbot,examples=EXAMPLES,additional_inputs=additional_inputs)9 unmodified lineschatbot.like(vote, None, None)chat_interface.render()demo.queue(concurrency_count=100, api_open=False).launch(show_api=False) #, share=True)9 unmodified lines10111213141516171847 unmodified lines6667686970717251 unmodified lines1241251261271281291301311321331341351361371381391409 unmodified lines1501511521531541559 unmodified linesAPI_URL = "https://api-inference.huggingface.co/models/DataAnalyticsLab/PersianGPT-FT-Grover"BOT_NAME = "PersianGPT-FT"stop_sequences = [] #["<|endoftext|>",">"]examples = [["<$غزل$@بر لبم هر ذره داغی می توان کردن"],["<$غزل$%صائب تبریزی%"],["<$قصاید$"],47 unmodified linesfor response in stream:output += responsefor stop_str in stop_sequences:if output.endswith(stop_str):output = output[:-len(stop_str)]output = output.rstrip()51 unmodified lines"""chatbot = gr.Chatbot(bubble_full_width = False)textbox = gr.Textbox(label="textbox",info="...Type something here",lines=5,value="",)chat_interface = gr.ChatInterface(generate,chatbot=chatbot,textbox=textbox,examples=examples,additional_inputs=additional_inputs)9 unmodified lineschatbot.like(vote, None, None)chat_interface.render()#textbox.change(fn=show_text, inputs=input, outputs=output, show_progress = True, status_tracker = None)demo.queue(concurrency_count=100, api_open=False).launch(show_api=False) #, share=True)
app.py+13-4