Skip to content

Commit

Permalink
polishing
Browse files Browse the repository at this point in the history
  • Loading branch information
artsiomkorzun committed Jan 9, 2025
1 parent bfce207 commit ad48122
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions aidial_code_interpreter/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ def read_file():

@app.post("/list_files")
def list_files(request: ListFilesRequest):
response = []
list = []
for root, _, files in os.walk(MOUNT_FOLDER):
for file in files:
path = os.path.join(root, file)
size = os.path.getsize(path)
response.append({"path": path, "size": size})
return response
list.append({"path": path, "size": size})
return {"files": list}


def resolve_file(file):
Expand Down
3 changes: 2 additions & 1 deletion aidial_code_interpreter/env.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
from pathlib import Path

UPLOAD_MAX_SIZE = int(os.environ.get("UPLOAD_MAX_SIZE", 512 * 1024 * 1024))
DOWNLOAD_CHUNK_SIZE = int(os.environ.get("DOWNLOAD_CHUNK_SIZE", 8 * 1024))
MOUNT_FOLDER = os.environ.get("MOUNT_FOLDER", os.getcwd())
MOUNT_FOLDER = str(Path(os.environ.get("MOUNT_FOLDER", "mount")).resolve())
LOG_LEVEL = os.environ.get("LOG_LEVEL", "INFO").upper()

0 comments on commit ad48122

Please sign in to comment.