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

Add Mixture-of-Miners endpoint #472

Merged
merged 51 commits into from
Dec 20, 2024
Merged

Conversation

dbobrenko
Copy link
Collaborator

@dbobrenko dbobrenko commented Nov 28, 2024

Changes

  • Add Mixture-of-Miners endpoint.
  • Move chat completions processing and mixture of miners into two separate functions.
  • Add system prompt to the inference task.

Usage example

To use mixture-of-miners, set mixture to True:

import openai
IP = "..."
PORT = "..."
API_KEY = "..."
prompt = "..."

client = openai.AsyncOpenAI(
    base_url=f"http://{IP}:{PORT}/v1",
    max_retries=0,
    api_key=API_KEY,
)

result = await client.chat.completions.create(
    model=None,
    messages=[{"role": "user", "content": prompt}],
    stream=stream,
    extra_body={
        "seed": seed,
        "sampling_parameters": {
            "temperature": 0.7,
            "top_p": 0.95,
            "top_k": 50,
            "max_new_tokens": 256,
            "do_sample": True,
            "seed": None,
        },
        "task": "QuestionAnsweringTask",
        "mixture": True,
    },
)

@dbobrenko dbobrenko self-assigned this Nov 28, 2024
@Hollyqui Hollyqui changed the base branch from kalei/api-working-branch to staging December 2, 2024 11:59
Copy link
Collaborator

@Hollyqui Hollyqui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See other comments

prompting/api/gpt_endpoints/mixture_of_miners.py Outdated Show resolved Hide resolved
prompting/api/gpt_endpoints/mixture_of_miners.py Outdated Show resolved Hide resolved
prompting/api/gpt_endpoints/mixture_of_miners.py Outdated Show resolved Hide resolved
prompting/tasks/task_registry.py Outdated Show resolved Hide resolved
scripts/test_api.py Outdated Show resolved Hide resolved
@dbobrenko dbobrenko marked this pull request as draft December 18, 2024 15:40
@dbobrenko dbobrenko requested a review from Hollyqui December 19, 2024 13:47
@dbobrenko dbobrenko marked this pull request as ready for review December 19, 2024 13:47
Copy link
Collaborator

@richwardle richwardle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Collaborator

@Hollyqui Hollyqui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dbobrenko dbobrenko merged commit b0d8e85 into staging Dec 20, 2024
2 checks passed
@dbobrenko dbobrenko deleted the feature/SN1-329-moa-endpoint branch December 20, 2024 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants