Skip to content

Commit 6250eef

Browse files
fixes for models download and nodes listing
1 parent ef4aad0 commit 6250eef

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

server/api/models/models.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ async def add_model(model, workspace_dir):
5757

5858
# check path is in workspace_dir, raises value error if not
5959
model_path.resolve().relative_to(Path(os.path.join(workspace_dir, "models")))
60-
60+
os.makedirs(model_path.parent, exist_ok=True)
6161
# start downloading the model in background without blocking
6262
asyncio.create_task(download_model(model['url'], model_path))
6363
except Exception as e:
@@ -81,7 +81,7 @@ async def delete_model(model, workspace_dir):
8181
async def download_model(url: str, save_path: Path):
8282
try:
8383
temp_file = save_path.with_suffix(save_path.suffix + ".downloading")
84-
84+
print("downloading")
8585
async with ClientSession() as session:
8686
logger.info(f"downloading model from {url} to {save_path}")
8787
# Create empty file to track download in process

server/api/nodes/nodes.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ async def list_nodes(workspace_dir):
1616

1717
nodes = []
1818
for node in custom_nodes_path.iterdir():
19+
if node.name == "__pycache__":
20+
continue
21+
1922
if node.is_dir():
2023
logger.info(f"getting info for node: { node.name}")
2124
node_info = {
@@ -57,7 +60,7 @@ async def install_node(node, workspace_dir):
5760
5861
installs requirements.txt from repository if present
5962
60-
paramaters:
63+
# Paramaters
6164
url: url of the git repository
6265
branch: branch to install
6366
dependencies: comma separated list of pip dependencies to install

0 commit comments

Comments
 (0)