hsuwill000 commited on
Commit
91a184a
·
verified ·
1 Parent(s): a9b4927

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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 > 50:
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: