File tree Expand file tree Collapse file tree 4 files changed +32
-13
lines changed 
examples/tabular-classification/sklearn/fetal-health Expand file tree Collapse file tree 4 files changed +32
-13
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77
88## [ Unreleased]  
99
10- ### Fixed  
10+ # Changed  
11+ 
12+ *  ` requirements_txt_file `  no longer optional for model uploads. 
13+ 
14+ # Fixed  
1115
1216*  Added protobuf==3.2.0 to requirements to fix bug with model deployment.
1317
Original file line number Diff line number Diff line change 611611 "source" : [
612612 " ## Unbox part!\n " 
613613 " \n " 
614+  " ### pip installing unboxapi" 
615+  ]
616+  },
617+  {
618+  "cell_type" : " code" 
619+  "execution_count" : null ,
620+  "metadata" : {},
621+  "outputs" : [],
622+  "source" : [
623+  " !pip install unboxapi" 
624+  ]
625+  },
626+  {
627+  "cell_type" : " markdown" 
628+  "metadata" : {},
629+  "source" : [
614630 " ### Instantiating the client" 
615631 ]
616632 },
Original file line number Diff line number Diff line change @@ -208,7 +208,7 @@ def add_model(
208208 model ,
209209 model_type : ModelType ,
210210 class_names : List [str ],
211-  requirements_txt_file : str   =   None ,
211+  requirements_txt_file : str ,
212212 feature_names : List [str ] =  [],
213213 categorical_feature_names : List [str ] =  [],
214214 train_sample_df : pd .DataFrame  =  None ,
Original file line number Diff line number Diff line change @@ -113,20 +113,19 @@ def _format_custom_code(custom_model_code: Optional[str]) -> str:
113113
114114
115115def  _env_dependencies (
116-  tmp_dir : str , requirements_txt_file : Optional [ str ] , setup_script : Optional [str ]
116+  tmp_dir : str , requirements_txt_file : str , setup_script : Optional [str ]
117117):
118118 unbox_req_file  =  f"{ tmp_dir }  
119119 env_wrapper_str  =  "" 
120-  if  not  requirements_txt_file :
121-  env_wrapper_str  +=  "@env(infer_pip_packages=True" 
122-  else :
123-  shutil .copy (requirements_txt_file , unbox_req_file )
124-  # Add required dependencies 
125-  deps  =  [f"bentoml=={ bentoml .__version__ }  , "pandas" ]
126-  with  open (unbox_req_file , "a" ) as  f :
127-  f .write ("\n " )
128-  [f .write (f"{ dep } \n " ) for  dep  in  deps ]
129-  env_wrapper_str  +=  f"@env(requirements_txt_file='{ unbox_req_file }  
120+ 
121+  shutil .copy (requirements_txt_file , unbox_req_file )
122+  # Add required dependencies 
123+  deps  =  [f"bentoml=={ bentoml .__version__ }  , "pandas" ]
124+  with  open (unbox_req_file , "a" ) as  f :
125+  f .write ("\n " )
126+  [f .write (f"{ dep } \n " ) for  dep  in  deps ]
127+ 
128+  env_wrapper_str  +=  f"@env(requirements_txt_file='{ unbox_req_file }  
130129
131130 # Add a user defined setup script to execute on startup 
132131 if  setup_script :
                         You can’t perform that action at this time. 
           
                  
0 commit comments