aws / amazon-sagemaker-examples

Example 📓 Jupyter notebooks that demonstrate how to build, train, and deploy machine learning models using 🧠 Amazon SageMaker.
https://sagemaker-examples.readthedocs.io
Apache License 2.0
10.06k stars 6.76k forks source link

Sagemaker[Example Request] #4451

Open YYyp99 opened 1 year ago

YYyp99 commented 1 year ago

I used Sagemaker's Jumpstart to directly deploy the llama2-7b-chat model, and now I need to perform a batch conversion task. However, when using this model, there was a 'Need to pass custom' issue Attributes='accept Eula=true 'as part of header', how can I solve this problem

`import sagemaker from sagemaker.transformer import Transformer

sagemaker_session = sagemaker.Session()

transformer = Transformer( model_name='meta-textgeneration-llama-2-7b-f-20230915-031114', instance_count=1, instance_type='ml.g4dn.12xlarge', strategy='SingleRecord', assemble_with='Line', output_path='s3://output/', base_transform_job_name='batch-transform-job1', sagemaker_session=sagemaker_session ) transformer.transform( 's3://test.json', content_type='text/json', split_type='Line' )`

Cage89 commented 11 months ago

similar question here, how does one do batch prediction using the jumpstart models?

Cage89 commented 11 months ago

okay something here could be relevant: https://github.com/aws/amazon-sagemaker-examples/blob/5c294c25541b51c53054ff4b4fd2629d8ece64d4/introduction_to_amazon_algorithms/jumpstart-foundation-models/text2text-generation-Batch-Transform.ipynb#L366

Cage89 commented 11 months ago

trying the same, but the model file doesnt seem to be a real tar

ClientError: An error occurred (ValidationException) when calling the CreateTransformJob operation: Model file at "s3://jumpstart-cache-prod-us-west-2/meta-infer/infer-meta-textgeneration-llama-2-7b-f.tar.gz" is not a GZipped file. Please ensure your model file is tarred and GZipped.