| import gradio as gr | |
| from conn import back_conn as bc | |
| def stream_function(input, history): | |
| res = bc.talk(input) | |
| s='' | |
| for r in res: | |
| s+=r | |
| yield s | |
| if __name__ == '__main__': | |
| demo = gr.ChatInterface(stream_function).queue() | |
| demo.launch(share=True) | |
| import gradio as gr | |
| from conn import back_conn as bc | |
| def stream_function(input, history): | |
| res = bc.talk(input) | |
| s='' | |
| for r in res: | |
| s+=r | |
| yield s | |
| if __name__ == '__main__': | |
| demo = gr.ChatInterface(stream_function).queue() | |
| demo.launch(share=True) | |