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

Unable to run flan t xxl #5

Closed
ysekiy opened this issue May 14, 2023 · 5 comments
Closed

Unable to run flan t xxl #5

ysekiy opened this issue May 14, 2023 · 5 comments

Comments

@ysekiy
Copy link
Contributor

ysekiy commented May 14, 2023

I got a following error when I run streamlit run app.py flanxxl and python3 kendra_retriever_flan_xxl.py

Error

ValueError: Error raised by inference endpoint: An error occurred (ModelError) when calling the InvokeEndpoint operation: Received server error (500) from primary with message "Input payload must contain text_inputs key. Traceback (most recent call last): File "/opt/conda/lib/python3.8/site-packages/sagemaker_inference/transformer.py", line 128, in transform result = self._transform_fn(self._model, input_data, content_type, accept) File "/opt/ml/model/code/inference.py", line 389, in transform_fn payload = _update_payload(payload) File "/opt/ml/model/code/inference.py", line 267, in _update_payload _validate_payload(payload, batch_params) File "/opt/ml/model/code/inference.py", line 189, in _validate_payload assert constants.TEXT_INPUTS in payload, f"Input payload must contain {constants.TEXT_INPUTS} key." AssertionError: Input payload must contain text_inputs key. ". See https://us-east-1.console.aws.amazon.com/cloudwatch/home?region=us-east-1#logEventViewer:group=/aws/sagemaker/Endpoints/jumpstart-dft-hf-text2text-flan-t5-xxl in account <Account ID> for more information.

A reproducible test case or series of steps

git clone https://github.com/aws-samples/amazon-kendra-langchain-extensions.git
cd amazon-kendra-langchain-extensions
python -m venv venv
source ./venv/bin/activate
pip install .
pip install ".[samples]"
export AWS_REGION="<YOUR-AWS-REGION>"
export KENDRA_INDEX_ID="<YOUR-KENDRA-INDEX-ID>"
export FLAN_XXL_ENDPOINT="<YOUR-SAGEMAKER-ENDPOINT-FOR-FLAN-T-XXL>"
cd samples
streamlit run app.py flanxxl

The version of our code being used

9bab4fa

Any modifications you've made relevant to the bug

n/a

Anything unusual about your environment or deployment

n/a

@ysekiy
Copy link
Contributor Author

ysekiy commented May 15, 2023

I made pull request. #6

@dimwael
Copy link

dimwael commented May 20, 2023

Amazing work ! It worked for me !

@mrglover
Copy link

mrglover commented Jun 8, 2023

@ysekiy thank you so much for this fix! I was searching where that input param was but stumbled on your fix...

One quick thing... I believe you switched the region_name param for the SagemakerEndpoint from the region variable to the "us-east-1" string literal... I am hosting mine in us-west-2 so this broke when I tried to run your fix. I also dropped a comment on the pull request.

THANKS AGAIN!

@ysekiy
Copy link
Contributor Author

ysekiy commented Jun 9, 2023

#6 (comment)

@MithilShah
Copy link
Contributor

Fixed in latest release

@ysekiy ysekiy closed this as completed Aug 17, 2023
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

4 participants