File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed
src/sagemaker/serve/builder Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -605,24 +605,19 @@ def build(
605
605
606
606
self .serve_settings = self ._get_serve_setting ()
607
607
608
+ sample_input , sample_output = task .retrieve_local_schemas ("text-generation" )
609
+ self .schema_builder = SchemaBuilder (sample_input , sample_output )
610
+
608
611
if isinstance (self .model , str ):
609
612
if self ._is_jumpstart_model_id ():
610
613
return self ._build_for_jumpstart ()
611
614
if self ._is_djl (): # pylint: disable=R1705
612
- if self .schema_builder is None :
613
- self ._schema_builder_init ("text-generation" )
614
-
615
615
return self ._build_for_djl ()
616
616
else :
617
617
hf_model_md = get_huggingface_model_metadata (
618
618
self .model , self .env_vars .get ("HUGGING_FACE_HUB_TOKEN" )
619
619
)
620
-
621
- hf_task = hf_model_md .get ("pipeline_tag" )
622
- if self .schema_builder is None :
623
- self ._schema_builder_init (hf_task )
624
-
625
- if hf_task == "text-generation" : # pylint: disable=R1705
620
+ if hf_model_md .get ("pipeline_tag" ) == "text-generation" : # pylint: disable=R1705
626
621
return self ._build_for_tgi ()
627
622
else :
628
623
return self ._build_for_transformers ()
You can’t perform that action at this time.
0 commit comments