main
黄海 1 year ago
parent f2ad2eda50
commit f85ddba582

@ -24,4 +24,6 @@ if float(used) > 20:
# 休息2分钟以保证SD重启完成
time.sleep(2 * 60)
else:
print("显存占用正常无法重新启动SD")
# 清理一下缓存即可
clear_webui_cache(webui_address)
print("显存占用正常无需重新启动SD清理一下缓存...")

@ -176,9 +176,10 @@ def get_webui_used(webui_server):
# free = jo[1].replace('free', '').replace(' ', '').replace(':', '').replace('GB', '')
used = jo[2].replace('used', '').replace(' ', '').replace(':', '').replace('GB', '')
used_lv = round(1.0 * (float(used)) / float(total) * 100, 2)
print("显存:" + total + "GB,已使用:" + used + "GB,使用率:" + str(used_lv) + '%')
# print("显存:" + total + "GB,已使用:" + used + "GB,使用率:" + str(used_lv) + '%')
else:
print("调用集成的获取显卡显存代码失败!")
# print("调用集成的获取显卡显存代码失败!")
pass
return total, used

Loading…
Cancel
Save