-
Notifications
You must be signed in to change notification settings - Fork 330
Read Tool & Reasoning Tokens from GenAI API instead of Catalog Metadata #838
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
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -111,6 +111,15 @@ OgaModel& GenAIModelInstance::GetOgaModel() { | |
| return *oga_model_; | ||
| } | ||
|
|
||
| std::string GenAIModelInstance::GetGenerationTag(const char* tag_name) const { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit:
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. agreed, renamed to |
||
| if (!oga_model_) { | ||
| return {}; | ||
| } | ||
| OgaString tag = oga_model_->GetGenerationTag(tag_name); | ||
| const char* p = tag; | ||
| return p ? std::string(p) : std::string(); | ||
| } | ||
|
|
||
| OgaTokenizer& GenAIModelInstance::GetOgaTokenizer() { | ||
| if (!tokenizer_) { | ||
| FL_THROW(FOUNDRY_LOCAL_ERROR_INTERNAL, "OGA tokenizer is null"); | ||
|
|
||
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 feels a little clunky to have a bunch of metadata coming from the catalog and some from the genai_config.json but we only merge those when creating a session.
Should we instead when populating the catalog models update the ModelInfo for a cached model to incorporate metadata from genai_config.json at that point? Same process post-download of a new model. That way all the other code doesn't need to know/care about the multiple sources of metadata - the just use the ModelInfo as-is.
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.
Good call. Refactored in the latest commit.
Model::Load()now populatesModelInfowith tool/reasoning tags from the GenAI model immediately after loading.BuildToolCallContext()is unchanged; it just reads fromModelInfoas before. Downstream code doesn't need to know about multiple metadata sources anymore.