-
Notifications
You must be signed in to change notification settings - Fork 477
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
FEAT: Code completions #1476
Open
mikeshi80
wants to merge
63
commits into
xorbitsai:main
Choose a base branch
from
mikeshi80:code_completions
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
FEAT: Code completions #1476
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…e unit test cases.
…to code_completions merge with main
# Conflicts: # xinference/model/llm/__init__.py
Need to add repo_name support.
…e definition for codeqwen1.5 and make it supported by vllm engine.
# Conflicts: # xinference/model/llm/__init__.py # xinference/model/llm/pytorch/core.py # xinference/web/ui/src/scenes/running_models/index.js
There are conflicts to resolve. |
# Conflicts: # xinference/core/model.py # xinference/model/llm/__init__.py # xinference/web/ui/src/scenes/running_models/index.js
# Conflicts: # xinference/model/llm/__init__.py
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added the support for code completions, support 3 kinds of completions:
I added two RESTful APIs:
/v1/code/prompt
v1/code/completions
Users can get the generated prompt by call 1st API.
Common Code Completion
POST the JSON object
Repository Level Code Completion
Users can provide files parameter , which is the mapping, key is file name or file path (it is defined in code prompt style), value is the file content.
Some model need the
repo_name
, that presents repository name.Note: if the model does not support repository level completion, it works like common code completion, "files" and "repo_name" will be ignored.
Infill Code Completion
Users can use infill mode by set mode to "infill", and provide suffix parameter.
Note: if the model does not support infill mode, you will get the exception.
If
/v1/code/prompt
API works well, it will return the response like below:When you get the generated prompt, you can pass it to
/v1/completions
to get the response.If you want to combine 2 requests into 1, you can just use the 2nd RESTful API
/v1/code/completions
, it just combined generating prompt and completions requests.