Update app.py
Browse files
app.py
CHANGED
@@ -5,8 +5,8 @@ client = InferenceClient(model="https://9bsneexhe83nu6-80.proxy.runpod.net")
|
|
5 |
|
6 |
def inference(message, history):
|
7 |
partial_message = ""
|
8 |
-
for token in client.text_generation(prompt=message, max_new_tokens=
|
9 |
-
top_p=0.
|
10 |
if token.startswith("<s>"):
|
11 |
return partial_message
|
12 |
partial_message += token
|
@@ -15,10 +15,10 @@ def inference(message, history):
|
|
15 |
gr.ChatInterface(
|
16 |
inference,
|
17 |
chatbot=gr.Chatbot(height=300, scale=7),
|
18 |
-
textbox=gr.Textbox(placeholder="你可以问我任何关于
|
19 |
-
description="
|
20 |
title="ChatSDB",
|
21 |
-
examples=["SequoiaDB巨杉数据库是什么?", "SequoiaDB巨杉数据库支持哪些类型的数据库实例?"
|
22 |
retry_btn="重试",
|
23 |
undo_btn="撤销",
|
24 |
clear_btn="清除",
|
|
|
5 |
|
6 |
def inference(message, history):
|
7 |
partial_message = ""
|
8 |
+
for token in client.text_generation(prompt=message, max_new_tokens=512, stream=True, best_of=1, temperature=0.3,
|
9 |
+
top_p=0.99, do_sample=True, repetition_penalty=1.0):
|
10 |
if token.startswith("<s>"):
|
11 |
return partial_message
|
12 |
partial_message += token
|
|
|
15 |
gr.ChatInterface(
|
16 |
inference,
|
17 |
chatbot=gr.Chatbot(height=300, scale=7),
|
18 |
+
textbox=gr.Textbox(placeholder="你可以问我任何关于SequioaDB的问题!", container=False, scale=7),
|
19 |
+
description="这是SequioaDB旗下的AI智能大语言模型,训练超过上万条真实数据和7亿参数。",
|
20 |
title="ChatSDB",
|
21 |
+
examples=["SequoiaDB巨杉数据库是什么?", "SequoiaDB巨杉数据库支持哪些类型的数据库实例?"],
|
22 |
retry_btn="重试",
|
23 |
undo_btn="撤销",
|
24 |
clear_btn="清除",
|