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

How to set system message to InternVL-Chat-V1-5?? #158

Open
Iven2132 opened this issue May 9, 2024 · 3 comments
Open

How to set system message to InternVL-Chat-V1-5?? #158

Iven2132 opened this issue May 9, 2024 · 3 comments

Comments

@Iven2132
Copy link

Iven2132 commented May 9, 2024

How to set the system message to InternVL-Chat-V1-5? I gave the model system message "Your name is Sam" and then asked "What is your name" it said "My name is AI". Can anyone help me? I'm using lmdeploy to deploy the model. But I can also use transformer to do that.

class Model:
    @modal.enter()
    def start_engine(self):
        import torch
        from lmdeploy import serve, ChatTemplateConfig
        print(MODEL_NAME)
        self.server = serve("OpenGVLab/InternVL-Chat-V1-5",
                            chat_template_config=ChatTemplateConfig(
                                model_name='internvl-internlm2'),
                            server_name='0.0.0.0',
                            server_port=23333)

    @modal.method()
    async def generate(self, messages):
        from lmdeploy import client
        handle = client(api_server_url='http://0.0.0.0:23333')
        model_name = handle.available_models[0]
        print(model_name)
        outputs = handle.chat_completions_v1(
            model=model_name, messages=messages)
        print(outputs)   
        for out in outputs:
            return out
@Iven2132
Copy link
Author

Any idea about this @czczup

@czczup
Copy link
Member

czczup commented May 16, 2024

Hello, I estimate that the effect of replacing the system message with this model is not good because a fixed system message was used during training, rather than training with varying system messages.

@Iven2132
Copy link
Author

Hello, I estimate that the effect of replacing the system message with this model is not good because a fixed system message was used during training, rather than training with varying system messages.

@czczup So how to prompt this model better? Any examples

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

No branches or pull requests

2 participants