-
Notifications
You must be signed in to change notification settings - Fork 159
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
feature: model metadata query #1749
Conversation
…ure/model-card-ui
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix some code-level, naming issues.
if group_type == ProjectType.MODEL_STORE: | ||
if params["permission"] != VFolderPermission.READ_WRITE: | ||
raise InvalidAPIParameters( | ||
"Setting custom permission is not supported for model store VFolder" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When mentioned in the middle of sentences, use "vfolder", not "VFolder".
@@ -450,7 +454,7 @@ async def create(request: web.Request, params: Any) -> web.Response: | |||
if group_uuid is not None: | |||
ownership_type = "group" | |||
quota_scope_id = QuotaScopeID(QuotaScopeType.PROJECT, group_uuid) | |||
if not request["is_admin"]: | |||
if not request["is_admin"] and group_type != ProjectType.MODEL_STORE: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this about forbidding model vfolder creation in the model store by a non-admin user?
Previously, project vfolder creation was already forbidden for non-admin users.
Is this additional condition strictly necessary? I think it may be better to just add comments.
|
||
def downgrade(): | ||
conn = op.get_bind() | ||
conn.execute(text("DELETE FROM groups WHERE name = 'model-store'")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should refer the type
column, not the name
column.
(FYI: To use a keyword like type
, user
, etc. as a column name in SQL, surround it with double-quotes.)
@@ -111,6 +114,11 @@ class AssocGroupUserRow(Base): | |||
group = relationship("GroupRow", back_populates="users") | |||
|
|||
|
|||
class ProjectType(str, enum.Enum): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use enum.StrEnum
as of Python 3.11 and for the new codes that won't be backported to 22.09 or older.
src/ai/backend/web/config.py
Outdated
@@ -75,6 +75,7 @@ | |||
t.Key("directory_based_usage", default=False): t.ToBool(), | |||
t.Key("allow_custom_resource_allocation", default=True): t.ToBool(), | |||
t.Key("edu_appname_prefix", default=""): t.String(allow_blank=True), | |||
t.Key("support_model_store", default=True): t.ToBool(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name should be enable_model_store
.
"Not support" means that we don't have the ability to serve the model store.
Here we should be clear that we DO support it but it's simply disabled when this field is set false.
@@ -30,6 +30,7 @@ connectionMode = "SESSION" | |||
{% toml_field "allowCustomResourceAllocation" config["service"]["allow_custom_resource_allocation"] %} | |||
{% toml_field "isDirectorySizeVisible" config["service"]["is_directory_size_visible"] %} | |||
{% toml_field "eduAppNamePrefix" config["service"]["edu_appname_prefix"] %} | |||
{% toml_field "supportModelStore" config["service"]["support_model_store"] %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
src/ai/backend/common/config.py
Outdated
@@ -121,6 +121,29 @@ | |||
), | |||
} | |||
), | |||
t.Key("info"): t.Null | t.Dict( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd suggest using a more concrete field name like "metadata" or "card".
…ure/model-card-ui
Co-authored-by: Jeongkyu Shin <[email protected]> Co-authored-by: Kyujin Cho <[email protected]>
related to #1066
Example
model-definition.yaml
fileQuery Model Info connection(list)
Query single Model Info node
Checklist: (if applicable)