Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use app url if no registry github url #3682

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions .github/workflows/get_modular_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,20 @@ async def connect() -> ViamClient:
)
return await ViamClient.create_from_dial_options(dial_options)

# ModelType is an enum and defined to render as int, convert back to string through this
# ModelType is an enum and defined to render as int, convert back to string through this
def model_type_to_str(model_type: int) -> str:
model_type_map = {
0: "Unspecified",
1: "Single Label Classification",
2: "Multi Label Classification",
3: "Object Detection",
}

try:
return model_type_map[model_type]
except KeyError:
raise ValueError(f"NEW UNKNOWN MODEL TYPE {model_type} must add to model type map")

def model_framework_to_str(model_framework: int) -> str:
model_framework_map = {
0: "Unspecified",
Expand All @@ -40,7 +40,7 @@ def model_framework_to_str(model_framework: int) -> str:
3: "Pytorch",
4: "ONNX"
}

try:
return model_framework_map[model_framework]
except KeyError:
Expand Down Expand Up @@ -70,12 +70,14 @@ async def main():
for module in module_list:
if module.visibility == 2:
for model in module.models:
app_url = "https://app.viam.com/module/" + module.public_namespace + "/" + module.name + "/"
json_m = {
"id": module.module_id + '-' + model.model,
"module_id": module.module_id,
"total_organization_usage": module.total_organization_usage,
"total_robot_usage": module.total_robot_usage,
"url": module.url,
"url": module.url or app_url,
"app_url": app_url,
"description": module.description,
"model": model.model,
"api": model.api,
Expand Down
Loading