Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -13,25 +13,14 @@ from config import InferConfig
|
|
| 13 |
|
| 14 |
infer_config = InferConfig()
|
| 15 |
chat_bot = ChatBot(infer_config=infer_config)
|
| 16 |
-
|
| 17 |
-
# print(streamer)
|
| 18 |
-
# streamer = chat_bot.stream_chat("你好")
|
| 19 |
-
# welcome_txt = '欢迎使用ChatBot,输入`exit`退出,输入`cls`清屏。\n'
|
| 20 |
-
# def build_prompt(history: list[list[str]]) -> str:
|
| 21 |
-
# prompt = welcome_txt
|
| 22 |
-
# for query, response in history:
|
| 23 |
-
# prompt += '\n\033[0;33;40m用户:\033[0m{}'.format(query)
|
| 24 |
-
# prompt += '\n\033[0;32;40mChatBot:\033[0m\n{}\n'.format(response)
|
| 25 |
-
# return prompt
|
| 26 |
-
# print(build_prompt(streamer))
|
| 27 |
|
| 28 |
def greet(name):
|
| 29 |
-
streamer = chat_bot.chat(
|
| 30 |
return streamer
|
| 31 |
-
# return "Hello " + name + "!!"
|
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
| 36 |
|
| 37 |
-
iface.launch(server_name='0.0.0.0', server_port=
|
|
|
|
| 13 |
|
| 14 |
infer_config = InferConfig()
|
| 15 |
chat_bot = ChatBot(infer_config=infer_config)
|
| 16 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
def greet(name):
|
| 19 |
+
streamer = chat_bot.chat(name)
|
| 20 |
return streamer
|
|
|
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
| 25 |
|
| 26 |
+
iface.launch(server_name='0.0.0.0', server_port=23677)
|