-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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(outlines): Add support outlines #1269
base: master
Are you sure you want to change the base?
Conversation
def Predict(self, request, context): | ||
try: | ||
#TODO: stop=["."] is a hard code, we need to make it configurable | ||
output=generate.continuation(self.model, stop=["."])(self.prompt) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would make sense here to reuse the stopwords that are already sent as part of the request
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
great addition @Aisuko ! |
@Aisuko how did you test it? can you give a small example to reproduce it? |
b2590a0
to
0423e4c
Compare
Signed-off-by: GitHub <[email protected]>
0423e4c
to
eb80c23
Compare
@mudler The PR already rebased from master branch. And I also add the test cases for every functions. The result is in the above comment. Please take a look. |
@@ -395,6 +396,7 @@ prepare-extra-conda-environments: | |||
$(MAKE) -C backend/python/huggingface | |||
$(MAKE) -C backend/python/vall-e-x | |||
$(MAKE) -C backend/python/exllama | |||
$(MAKE) -C backend/python/backend_outlines |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this needs to be added also in the Dockerfile here:
Line 153 in 991ecce
## Duplicated from Makefile to avoid having a big layer that's hard to push |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
# get the directory where the bash script is located | ||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | ||
|
||
python $DIR/backend_outlines.py $@ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make sure the file has executable bits, and the wrapper needs to be also listed here:
Line 15 in 991ecce
ENV EXTERNAL_GRPC_BACKENDS="huggingface-embeddings:/build/backend/python/huggingface/run.sh,autogptq:/build/backend/python/autogptq/run.sh,bark:/build/backend/python/bark/run.sh,diffusers:/build/backend/python/diffusers/run.sh,exllama:/build/backend/python/exllama/run.sh,vall-e-x:/build/backend/python/vall-e-x/run.sh,vllm:/build/backend/python/vllm/run.sh" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
is there maybe a way we can connect more complex features like https://github.com/outlines-dev/outlines#efficient-regex-guided-generation of outlines? I think the real gain would be to have guided output rather then generic output |
Signed-off-by: GitHub <[email protected]>
Agree with you, here the PR only including the basic one. And we can implement this. However, if we want to connect regex-guided generation, we may need to add a new parameter for regex-guided to What's your thought? |
Outlines author here, let me know if you need any help! |
maybe we can re-use the grammar field? But I see that outlines support JSON schema already, and that we have already as we support OpenAI functions, maybe we can re-use that feature and pass down to the backends also the json schema? @rlouf is there an example that I can find with JSON schemas? that'd be great so could probably help @Aisuko and me here to speed it up :) |
|
Description
This PR fixes #1261
Notes for Reviewers
Please kindly check the demo on Kaggle
Update
This PR has been tested
Signed commits