Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -21,7 +21,12 @@ def respond(
|
|
21 |
top_p,
|
22 |
):
|
23 |
try:
|
24 |
-
|
|
|
|
|
|
|
|
|
|
|
25 |
|
26 |
messages = [{"Role": "system", "Content": default_system}]
|
27 |
client = OpenAI(
|
@@ -78,5 +83,5 @@ demo = gr.ChatInterface(respond,
|
|
78 |
)
|
79 |
|
80 |
if __name__ == "__main__":
|
81 |
-
demo.queue(default_concurrency_limit=
|
82 |
-
demo.launch(max_threads=
|
|
|
21 |
top_p,
|
22 |
):
|
23 |
try:
|
24 |
+
weekdays = ["周一", "周二", "周三", "周四", "周五", "周六", "周日"]
|
25 |
+
now = datetime.now()
|
26 |
+
weekday_num = now.weekday()
|
27 |
+
weekday_chinese = weekdays[weekday_num]
|
28 |
+
formatted_time = now.strftime("%Y-%m-%d %H:%M:%S") + " " + weekday_chinese
|
29 |
+
default_system = f"你是一个由腾讯开发的有用的人工智能助手,你的名字是“腾讯元宝”,简称“元宝”,你的英文名是“Tencent Yuanbao”,你乐于帮助大家解答问题。\n现在的时间是{formatted_time}"
|
30 |
|
31 |
messages = [{"Role": "system", "Content": default_system}]
|
32 |
client = OpenAI(
|
|
|
83 |
)
|
84 |
|
85 |
if __name__ == "__main__":
|
86 |
+
demo.queue(default_concurrency_limit=100)
|
87 |
+
demo.launch(max_threads=100)
|