Open
Conversation
Open
This file contains hidden or 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
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.
Currently,
weave.pycontains separate functions to infer using OpenAI or VLLM. But both of these APIs, as well as a number of others, are based on the OpenAI v1 completions API. Supporting arbitrary APIs is just a matter of changing base url and API key.I made some changes to
weave.pyinference functions and args to support this. Examples to try:python weave.py --gen-model-name mistralai/Mistral-7B-v0.1 --eval-model-name jdpressman/minihf_evaluator_mistral_7b_v0.1python weave.py --gen-model-name openai-community/gpt2 --eval-model-name davinci-002 --eval-api-base https://api.openai.com/v1/completions --eval-api-key $OPENAI_API_KEYrepetition_penaltyandtop_kin theevaluate_outputs_apipayload to get it to workpython weave.py --gen-model-name mistralai/Mistral-7B-v0.1 --gen-api-base https://api.together.xyz/v1/completions --gen-api-key $TOGETHERAI_API_KEY --eval-model-name Meta-Llama-3-8B-Q4_5_M --eval-api-base http://localhost:5000/v1/completionsseedin thegenerate_outputs_apipayload to get it to workIt's not ideal that getting certain APIs to work requires so much commenting, but I'd prefer to handle that via config files rather than tacking on more command line args, and that seems like a job for a separate PR.