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

fix huggingface generate text #1733

Closed
wants to merge 1 commit into from

Conversation

jitokim
Copy link
Contributor

@jitokim jitokim commented Nov 13, 2024

fix issue #1727 when using text-generation-inference models

I think the openapi.json needs to be fixed.
you can find the response type is an array here

test models:
microsoft/Phi-3-mini-4k-instruct
mistralai/Mistral-7B-Instruct-v0.3
Qwen/Qwen2.5-Coder-32B-Instruct

microsoft/Phi-3-mini-4k-instruct
image

mistralai/Mistral-7B-Instruct-v0.3
image

Qwen/Qwen2.5-Coder-32B-Instruct
image

@jitokim jitokim marked this pull request as ready for review November 13, 2024 14:37
@ilayaperumalg ilayaperumalg self-assigned this Nov 13, 2024
update openapi.json

Signed-off-by: jitokim <[email protected]>
@jitokim
Copy link
Contributor Author

jitokim commented Nov 13, 2024

i found the response type is an array here

        // wrap generation inside a Vec to match api-inference
        Ok((headers, Json(vec![generation])).into_response())

@ilayaperumalg
Copy link
Member

Hi @jitokim, Thanks for the fix! LGTM, merged as 3c14fa6 after updating the ClientIT's prompt message to insist on providing strict JSON output so that the test assertion has more probability of passing.

@jitokim
Copy link
Contributor Author

jitokim commented Nov 15, 2024

@ilayaperumalg Hi.
I was wondering how to compare Markdown format with the expected value, and you've solved it in a very smart way. I've learned a great approach from you. Thank you!

@ilayaperumalg
Copy link
Member

@jitokim Thank you for the kind words! It was the suggestion from @markpollack!

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

Successfully merging this pull request may close these issues.

2 participants