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

Explicitly set "model" property for models that support it #783

Merged
merged 1 commit into from
Jan 9, 2024
Merged

Conversation

saqadri
Copy link
Contributor

@saqadri saqadri commented Jan 5, 2024

Explicitly set "model" property for models that support it

This change allows us to automatically set the "model" for the following model parsers:

  • OpenAI
  • Anyscale Endpoint
  • Hugging Face text generation
  • PaLM
  • Dall-E

Without this change the local editor breaks because if a user doesn't explicitly specify the "model" property in settings metadata, inference fails for (some of) the above model parsers. This isn't ideal, because the user has already selected the model they want to use from the model selector, so shouldn't need to additionally specify a model id as well.

There is still a larger issue of how we distinguish a model ID from a model parser ID. Filed #782 to come up with a proper fix for that.

@rossdanlm
Copy link
Contributor

This feels really weird to make the model parsers do this instead of adding it as a centralized SDK functionality. See comments in here for how I think we should do it: #765 (comment)

Do you want me to take over this task? I can do it

@saqadri
Copy link
Contributor Author

saqadri commented Jan 5, 2024

This feels really weird to make the model parsers do this instead of adding it as a centralized SDK functionality. See comments in here for how I think we should do it: #765 (comment)

Do you want me to take over this task? I can do it

Chatted offline with @rossdanlm, we are good to go with this change. Different model parsers can have different properties so it isn't possible to have a centralized place to do this.

@saqadri saqadri force-pushed the pr783 branch 2 times, most recently from 3424127 to 4925521 Compare January 5, 2024 22:04
@saqadri saqadri marked this pull request as ready for review January 5, 2024 22:04
@jonathanlastmileai
Copy link
Contributor

I think this is probably the right solution currently, just need to make sure it's well tested.

Note that this takes the stance that an AIConfig can be valid even with a "dangling foreign key" to the global model mapping, and it's the parser's responsibility to fill in the gap. IMO it would be better to constrain AIConfigs to not have dangling pointers, but I don't know if that can actually be enforced currently via the CRUD API.

@saqadri saqadri mentioned this pull request Jan 5, 2024
Copy link
Contributor

@rholinshead rholinshead left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parser changes look good but I think we should refrain from pulling 'model' from model.settings as part of the sdk since there's no guarantee it's related to any model parser; it could technically be some other meaning

@saqadri saqadri force-pushed the pr783 branch 3 times, most recently from ead4a6e to 4beeaf5 Compare January 9, 2024 17:16
This change allows us to automatically set the "model" for the following model parsers:
* OpenAI
* Anyscale Endpoint
* Hugging Face text generation
* PaLM
* Dall-E

Without this change the local editor breaks because if a user doesn't explicitly specify the "model" property in settings metadata, inference fails for (some of) the above model parsers. This isn't ideal, because the user has already selected the model they want to use from the model selector, so shouldn't need to additionally specify a model id as well.

There is still a larger issue of how we distinguish a model ID from a model parser ID. Filed #782 to come up with a proper fix for that.
@saqadri
Copy link
Contributor Author

saqadri commented Jan 9, 2024

Test plan:

Validation.mov

Also tested with dalle3 (not shown)

Copy link
Contributor

@rholinshead rholinshead left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@saqadri saqadri merged commit 5c824e3 into main Jan 9, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants