File size: 805 Bytes
a5fe767
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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)