mirror of
https://github.com/ParisNeo/lollms-webui.git
synced 2024-12-19 04:17:52 +00:00
added ram usage endpoint
This commit is contained in:
parent
5f2b53e309
commit
afd8d2a4ef
16
app.py
16
app.py
@ -90,6 +90,10 @@ class LoLLMsWebUI(LoLLMsAPPI):
|
||||
"/disk_usage", "disk_usage", self.disk_usage, methods=["GET"]
|
||||
)
|
||||
|
||||
self.add_endpoint(
|
||||
"/ram_usage", "ram_usage", self.ram_usage, methods=["GET"]
|
||||
)
|
||||
|
||||
|
||||
self.add_endpoint(
|
||||
"/list_bindings", "list_bindings", self.list_bindings, methods=["GET"]
|
||||
@ -456,6 +460,18 @@ class LoLLMsWebUI(LoLLMsAPPI):
|
||||
print("Set config results:")
|
||||
print(result)
|
||||
return jsonify(result)
|
||||
def ram_usage(self):
|
||||
"""
|
||||
Returns the RAM usage in bytes.
|
||||
"""
|
||||
ram = psutil.virtual_memory()
|
||||
return jsonify({
|
||||
"total_space":ram.total,
|
||||
"available_space":ram.free,
|
||||
|
||||
"percent_usage":ram.percent,
|
||||
"binding_models_usage": ram.used
|
||||
})
|
||||
|
||||
def disk_usage(self):
|
||||
current_drive = Path.cwd().anchor
|
||||
|
Loading…
Reference in New Issue
Block a user