mirror of
https://github.com/infinition/Bjorn.git
synced 2026-03-11 07:01:59 +00:00
Add RLUtils class for managing RL/AI dashboard endpoints
- Implemented methods for fetching AI stats, training history, and recent experiences. - Added functionality to set operation mode (MANUAL, AUTO, AI) with appropriate handling. - Included helper methods for querying the database and sending JSON responses. - Integrated model metadata extraction for visualization purposes.
This commit is contained in:
@@ -7,7 +7,6 @@ from __future__ import annotations
|
||||
import os
|
||||
import json
|
||||
import shutil
|
||||
import cgi
|
||||
from pathlib import Path
|
||||
from io import BytesIO
|
||||
from typing import Any, Dict, Optional
|
||||
@@ -155,7 +154,7 @@ class FileUtils:
|
||||
handler.send_header("Content-Disposition", f'attachment; filename="{os.path.basename(file_path)}"')
|
||||
handler.end_headers()
|
||||
with open(file_path, 'rb') as file:
|
||||
handler.wfile.write(file.read())
|
||||
shutil.copyfileobj(file, handler.wfile)
|
||||
else:
|
||||
handler.send_response(404)
|
||||
handler.end_headers()
|
||||
|
||||
Reference in New Issue
Block a user