Update app.py
Browse files
app.py
CHANGED
@@ -15,7 +15,7 @@ pipe = pipeline("text-generation", model=model, tokenizer=tokenizer)
|
|
15 |
def respond(message):
|
16 |
# 取得 CPU 使用率(0.1 秒內的平均值)
|
17 |
cpu_usage = psutil.cpu_percent(interval=0.1)
|
18 |
-
if cpu_usage >
|
19 |
# CPU 使用率超過 50%,直接返回忙碌提示訊息
|
20 |
return [(message, "系統目前忙碌中,請稍候...")]
|
21 |
else:
|
|
|
15 |
def respond(message):
|
16 |
# 取得 CPU 使用率(0.1 秒內的平均值)
|
17 |
cpu_usage = psutil.cpu_percent(interval=0.1)
|
18 |
+
if cpu_usage > 80:
|
19 |
# CPU 使用率超過 50%,直接返回忙碌提示訊息
|
20 |
return [(message, "系統目前忙碌中,請稍候...")]
|
21 |
else:
|