Skip to content

Commit

Permalink
No public description
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 715054197
  • Loading branch information
yishuangP authored and copybara-github committed Jan 13, 2025
1 parent 765452e commit 03aed27
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions mediapipe/tasks/cc/genai/inference/c/llm_inference_engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,9 @@ typedef struct {
// initialization may finish before weights have finished uploading which
// might push some of the weight upload time into input processing.
bool wait_for_weight_uploads;

// Whether the submodel should be used if available.
bool use_submodel;
} LlmModelSettings;

// LlmSessionConfig configures how to execute the model.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ import MediaPipeTasksGenAIC
max_top_k: options.maxTopk,
llm_activation_data_type: kLlmActivationDataTypeDefault,
num_draft_tokens: 0,
wait_for_weight_uploads: options.waitForWeightUploads)
wait_for_weight_uploads: options.waitForWeightUploads,
use_submodel: options.useSubmodel)
return try LlmTaskRunner(modelSettings: modelSetting)
}
}
Expand Down Expand Up @@ -240,6 +241,9 @@ extension LlmInference {
/// time into input processing.
@objc public var waitForWeightUploads: Bool = false

// Whether to use the submodel if available.
@objc public var useSubmodel: Bool = false

/// Creates a new instance of `Options` with the given `modelPath` and default values of
/// `maxTokens`, `maxTopk`, `supportedLoraRanks`.
/// This function is only intended to be used from Objective C.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ LlmModelSettings ParseModelSettings(void* bytes, int size) {
output.llm_activation_data_type = kLlmActivationDataTypeDefault;
output.num_draft_tokens = 0;
output.wait_for_weight_uploads = false;
output.use_submodel = false;
return output;
}

Expand Down

0 comments on commit 03aed27

Please sign in to comment.