from fastapi import FastAPI import gradio as gr import uvicorn import socket from interaction import MindBot CUSTOM_PATH = "/mindbot/541832" # @app.get("/") # def read_main(): # return {"message": "This is your main app"} mind_bot = MindBot( "/cognitive_comp/songchao/mindbot_demo/checkpoint", "/cognitive_comp/songchao/checkpoints/13B-c-pretrain-tokenizer", if_int8=True ) # @app.get("/api/mindbot/541832") # async def chat(query, clear_history=False): # output = mind_bot.common_generate(query, clear_history) # return output # host = socket.gethostbyname(socket.gethostname()) # print(f'demo run on {host}') demo = mind_bot.new_chat_bot() demo.launch(share=True) # app = gr.mount_gradio_app(app, demo, path=CUSTOM_PATH) # uvicorn.run(app, host='192.168.81.9', port=7880)