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

Fixes for openai server example #1221

Merged
merged 2 commits into from
Aug 31, 2023
Merged

Fixes for openai server example #1221

merged 2 commits into from
Aug 31, 2023

Conversation

mgoin
Copy link
Member

@mgoin mgoin commented Aug 31, 2023

Thanks to @dsikka for noticing the current outputs of the server were garbage - the pipeline was returning only the tokens delta during streaming rather than the ongoing concatenated text.

Also implement full support for non-streaming.

Start the server with:

python examples/openai-server/server.py --model zoo:nlg/text_generation/codegen_mono-350m/pytorch/huggingface/bigpython_bigquery_thepile/base-none

And hit it with a prompt request:

curl http://localhost:8000/v1/completions \                                                                                                                                  
    -H "Content-Type: application/json" \
    -d '{
        "model": "zoo:nlg/text_generation/codegen_mono-350m/pytorch/huggingface/bigpython_bigquery_thepile/base-none",
        "prompt": "def fib():",
        "max_tokens": 30
    }'  
    
{"id":"cmpl-90fc6217001d4556973b2b82ebc44270","object":"text_completion","created":1693451970,"model":"zoo:nlg/text_generation/codegen_mono-350m/pytorch/huggingface/bigpython_bigquery_thepile/base-none","choices":[{"index":0,"text":"\n    a, b = 0, 1\n    while True:\n        yield a\n        a, b = b, a + b","logprobs":null,"finish_reason":"stop"}]}

@mgoin mgoin marked this pull request as ready for review August 31, 2023 03:21
@mgoin mgoin requested review from bfineran and dsikka August 31, 2023 03:22
@InquestGeronimo InquestGeronimo self-requested a review August 31, 2023 17:43
@mgoin mgoin merged commit 46ea1db into main Aug 31, 2023
6 of 7 checks passed
@mgoin mgoin deleted the openai-server-full-text branch August 31, 2023 18:41
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