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

[API] Add octoai back-end #936

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Prev Previous commit
Next Next commit
add temperature and top_p parameters to octoai request
  • Loading branch information
vvchernov committed Oct 25, 2023
commit bbfc0190b8f5cb69f3b49030198ed646ca6b28de
12 changes: 8 additions & 4 deletions lm_eval/models/octoai_llms.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ def __init__(
model_name="llama2-7b-chat-mlc-q0f16",
batch_size=1,
max_batch_size=None,
device=None):
device=None,
top_p=0.0,
temperature=0.0,):
"""
:param model_name: str
Model name from the list of models supported by OctoAI
Expand All @@ -52,9 +54,9 @@ def __init__(
self._device=device
# TODO(vvchernov): check that model name is supported

self.init_remote()
self.init_remote(top_p, temperature)

def init_remote(self):
def init_remote(self, top_p, temperature):
# Get the API key from the environment variables
api_key=os.environ["OCTOAI_API_KEY"]

Expand All @@ -78,7 +80,9 @@ def init_remote(self):
}
],
"stream": False,
"max_tokens": 256
"max_tokens": 256,
"top_p": top_p,
"temperature": temperature,
}

@property
Expand Down