Skip to content

Commit e4e5d5e

Browse files
chunnienccopybara-github
authored andcommitted
No public description
PiperOrigin-RevId: 874164579
1 parent 73d49ce commit e4e5d5e

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

litert_torch/generative/export_hf/core/export_lib.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,10 @@ def export_text_prefill_decode_model(
312312
sample_kwargs=sample_decode_inputs,
313313
)
314314

315-
lrt_model = converter.convert(strict_export=False)
315+
lrt_model = converter.convert(
316+
lightweight_conversion=True,
317+
strict_export=False,
318+
)
316319

317320
lrt_model = mu_pass_lib.update_model(lrt_model)
318321
if export_config.experimental_use_mixed_precision:
@@ -400,7 +403,10 @@ def export_embedder_model(
400403
embedder_module.eval(),
401404
sample_kwargs=sample_inputs,
402405
)
403-
lrt_model = converter.convert(strict_export=False)
406+
lrt_model = converter.convert(
407+
lightweight_conversion=True,
408+
strict_export=False,
409+
)
404410
model_path = os.path.join(work_dir, 'embedder.tflite')
405411
lrt_model.export(model_path)
406412
quantization_recipe_list = (
@@ -584,7 +590,7 @@ def export_additional_models(
584590
source_model_artifacts: SourceModelArtifacts,
585591
export_config: exportable_module.ExportableModuleConfig,
586592
exported_model_artifacts: ExportedModelArtifacts,
587-
)-> ExportedModelArtifacts:
593+
) -> ExportedModelArtifacts:
588594
"""Exports embedder."""
589595
exportable_model_cls_dict = model_ext_exportables.get_additional_exportables(
590596
source_model_artifacts.model_config

0 commit comments

Comments
 (0)