Skip to content

Commit 7ce5e18

Browse files
sirakiincopybara-github
authored andcommitted
No public description
PiperOrigin-RevId: 837271147
1 parent f631f41 commit 7ce5e18

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

ai_edge_torch/generative/utilities/litertlm_builder.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,8 @@ def build_litertlm(
114114

115115
llm_metadata.max_num_tokens = context_length
116116

117-
if (
118-
llm_metadata.llm_model_type
119-
== llm_model_type_pb2.LlmModelType.generic_model
120-
):
117+
mdl_type = llm_metadata.llm_model_type.WhichOneof('model_type')
118+
if not mdl_type or mdl_type == 'generic_model':
121119
match llm_model_type:
122120
case litertlm_builder.LlmModelType.GENERIC:
123121
llm_metadata.llm_model_type.CopyFrom(

0 commit comments

Comments
 (0)