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

Support Chat API #111

Open
madroidmaq opened this issue Nov 13, 2024 · 4 comments
Open

Support Chat API #111

madroidmaq opened this issue Nov 13, 2024 · 4 comments

Comments

@madroidmaq
Copy link

Hope to support the API style for Chat (friendly to multi-turn conversations), currently it seems to be nearly supporting generate.

For example, in a similar way to the code example like Qwen/Qwen2-VL-2B-Instruct as follows:

messages = [
    {
        "role": "user",
        "content": [
            {
                "type": "image",
                "image": "https://qianwen-res.oss-cn-beijing.aliyuncs.com/Qwen-VL/assets/demo.jpeg",
            },
            {"type": "text", "text": "Describe this image."},
        ],
    }
]

# apply messages
...
@Blaizzy
Copy link
Owner

Blaizzy commented Nov 13, 2024

You can do this manually.

I will later check if there is a great way to integrate this. The problem is that not all models support this format.

@Blaizzy
Copy link
Owner

Blaizzy commented Nov 13, 2024

Also we have a multi-turn example here:

#68 (comment)

@madroidmaq
Copy link
Author

Also we have a multi-turn example here:

#68 (comment)

Thanks, this example worked for me.

@Blaizzy
Copy link
Owner

Blaizzy commented Nov 14, 2024

My pleasure!

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