Support for local models (+ Other OpenAI compatible end-points)#32
Support for local models (+ Other OpenAI compatible end-points)#32tijszwinkels wants to merge 8 commits intotogethercomputer:mainfrom
Conversation
Use OPENAI_API_KEY, OPENAI_BASE_URL, REFERENCE_API_KEY, REFERENCE_BASE_URL (REFERENCE_API_KEY is what used to be OPENAI_API_KEY) This way, we can easily connect to third-party api's.
b7d3887 to
433ff73
Compare
requirements.txt
Outdated
| datasets | ||
| typer | ||
| rich | ||
| cffi |
There was a problem hiding this comment.
In my testing, this seems required through the 'datasets' import:
Without it:
conda create --name moa-test python=3.11
conda activate moa-test
pip install -r requirements.txt
tijs@Perplexity MoA % DEBUG=1 python bot.py --model "groq/mixtral-8x7b-32768" --reference-models "groq/llama3-70b-8192" --reference-models "groq/mixtral-8x7b-32768" --reference-models "groq/gemma2-9b-it" --rounds 2
Traceback (most recent call last):
File "/Users/tijs/os/MoA/bot.py", line 1, in <module>
import datasets
File "/opt/homebrew/anaconda3/envs/moa-test/lib/python3.11/site-packages/datasets/__init__.py", line 17, in <module>
from .arrow_dataset import Dataset
File "/opt/homebrew/anaconda3/envs/moa-test/lib/python3.11/site-packages/datasets/arrow_dataset.py", line 75, in <module>
from . import config
File "/opt/homebrew/anaconda3/envs/moa-test/lib/python3.11/site-packages/datasets/config.py", line 145, in <module>
importlib.import_module("soundfile").__libsndfile_version__
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/opt/homebrew/anaconda3/envs/moa-test/lib/python3.11/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/tijs/.local/lib/python3.11/site-packages/soundfile.py", line 17, in <module>
from _soundfile import ffi as _ffi
File "/Users/tijs/.local/lib/python3.11/site-packages/_soundfile.py", line 2, in <module>
import _cffi_backend
ModuleNotFoundError: No module named '_cffi_backend'
(moa-test)
There was a problem hiding this comment.
Actually, you're right. This looks like a bug in whatever version of 'datasets' I happened to pick up. I removed it.
So: Done!
|
|
||
| You can configure the demo by specifying the following parameters: | ||
|
|
||
| - `--aggregator`: The primary model used for final response generation. |
There was a problem hiding this comment.
Why are we renaming this parameter?
There was a problem hiding this comment.
the documentation is incorrect. Typer will just get the parameters from the main function, where 'model' is used to define the primary model.
I changed the code to use --aggregator instead of --model
bot.py
Outdated
| model = Prompt.ask( | ||
| "\n1. What main model do you want to use?", | ||
| default="Qwen/Qwen2-72B-Instruct", | ||
| default=model, |
|
Thanks @tijszwinkels I look forward to using this |
|
@jkennedyvz I'll leave it up to you to resolve the conversations, but I think this should be it for the review:
|
These changes allow to use other OpenAI compatible api endpoints by setting the
OPENAI_BASE_URLandOPENAI_API_KEYenv. variable.See Readme for more details.