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

[LLM] Provide an interface used for loading model on the Fastchat side #10282

Closed
wants to merge 8 commits into from
Closed

Conversation

Zephyr596
Copy link
Contributor

Description

Similar to lm-sys/FastChat#2888, we can provide an example implementation for worker that extends the BaseModelWorker, which should override the following three methods:

def generate_stream_gate(self, params):
    raise NotImplementedError

def generate_gate(self, params):
    raise NotImplementedError

def get_embeddings(self, params):
    raise NotImplementedError

After that, we can provide a bigdl_worker and a documentation on how to use it.

The controller and worker communicates through a set of interfaces, you can check this at here https://github.com/lm-sys/FastChat/blob/main/fastchat/serve/base_model_worker.py#L196. Therefore, if bigdl_worker can successfully implement these interfaces, we can integrate BigDL-LLM into FastChat.

1. Why the change?

Similar to https://github.com/lm-sys/FastChat/blob/main/fastchat/serve/mlx_worker.py#L33, we can provide a interface at BigDL side that provide the functionalities of loading models so that we can keep the code at FastChat side stable.

User will start the controller normally, but use like python3 -m fastchat.serve.bigdl_worker --model-names "bigdl-models" --model-path lmsys/vicuna-7b-v1.5 to start the worker.

2. User API changes

from bigdl.llm.utils import load_model

3. Summary of the change

Provide an interface used for loading model on the Fastchat side

4. How to test?

  • Unit test
  • Application test
    .

5. New dependencies

None

@Zephyr596 Zephyr596 requested a review from gc-fu March 5, 2024 01:49
@gc-fu
Copy link
Contributor

gc-fu commented Mar 5, 2024

Closed and moved to #10323

@gc-fu gc-fu closed this Mar 5, 2024
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.

2 participants