AurelioAguirre commited on
Commit
1bcc710
·
1 Parent(s): 857919b

Changing init to use params

Browse files
Files changed (1) hide show
  1. main/api.py +5 -1
main/api.py CHANGED
@@ -114,6 +114,10 @@ class InferenceApi(LitAPI):
114
  self.logger.error(f"Error in download_model: {str(e)}")
115
  raise
116
 
 
 
 
 
117
  async def validate_system(self) -> Dict[str, Any]:
118
  """Validate system configuration and setup."""
119
  self.logger.debug("Validating system configuration...")
@@ -138,7 +142,7 @@ class InferenceApi(LitAPI):
138
  async with await self._get_client() as client:
139
  response = await client.post(
140
  self._get_endpoint('model_initialize'),
141
- json={"model_name": model_name} if model_name else {}
142
  )
143
  response.raise_for_status()
144
  return response.json()
 
114
  self.logger.error(f"Error in download_model: {str(e)}")
115
  raise
116
 
117
+ except Exception as e:
118
+ self.logger.error(f"Error initiating model download: {str(e)}")
119
+ raise
120
+
121
  async def validate_system(self) -> Dict[str, Any]:
122
  """Validate system configuration and setup."""
123
  self.logger.debug("Validating system configuration...")
 
142
  async with await self._get_client() as client:
143
  response = await client.post(
144
  self._get_endpoint('model_initialize'),
145
+ params={"model_name": model_name} if model_name else None
146
  )
147
  response.raise_for_status()
148
  return response.json()