Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting "TypeError: can only join an iterable" while running "print(predictor.predict(test_data).decode("utf-8"))" #4593

Open
Arpitgit11 opened this issue Mar 15, 2024 · 0 comments

Comments

@Arpitgit11
Copy link

Link to the .ipynb file
https://github.com/aws/amazon-sagemaker-examples/blob/main/advanced_functionality/scikit_bring_your_own/scikit_bring_your_own.ipynb

Describe the bug
to me looks like predic() function is expecting a diff input

To reproduce
run all previous steps of .ipynb file till line:
print(predictor.predict(test_data).decode("utf-8"))

Logs
TypeError Traceback (most recent call last)
Cell In[89], line 2
1 import pandas as pd
----> 2 print(predictor.predict(test_data).decode("utf-8"))

File ~/anaconda3/envs/python3/lib/python3.10/site-packages/sagemaker/base_predictor.py:196, in Predictor.predict(self, data, initial_args, target_model, target_variant, inference_id, custom_attributes, component_name)
155 """Return the inference from the specified endpoint.
156
157 Args:
(...)
193 as is.
194 """
195 # [TODO]: clean up component_name in _create_request_args
--> 196 request_args = self._create_request_args(
197 data=data,
198 initial_args=initial_args,
199 target_model=target_model,
200 target_variant=target_variant,
201 inference_id=inference_id,
202 custom_attributes=custom_attributes,
203 )
205 inference_component_name = component_name or self._get_component_name()
206 if inference_component_name:

File ~/anaconda3/envs/python3/lib/python3.10/site-packages/sagemaker/base_predictor.py:256, in Predictor._create_request_args(self, data, initial_args, target_model, target_variant, inference_id, custom_attributes)
251 args["ContentType"] = jumpstart_content_type
252 else:
253 args["ContentType"] = (
254 self.content_type
255 if isinstance(self.content_type, str)
--> 256 else ", ".join(self.content_type)
257 )
259 if "Accept" not in args:
260 if isinstance(data, JumpStartSerializablePayload) and jumpstart_accept:

TypeError: can only join an iterable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant