Skip to content

Added Mllama#619

Merged
tgaddair merged 6 commits intomainfrom
mllama
Sep 30, 2024
Merged

Added Mllama#619
tgaddair merged 6 commits intomainfrom
mllama

Conversation

@tgaddair
Copy link
Contributor

@tgaddair tgaddair commented Sep 27, 2024

See: https://huggingface.co/meta-llama/Llama-3.2-11B-Vision-Instruct

Based on TGI implementation here: huggingface/text-generation-inference#2568

Usage:

from lorax import Client


endpoint_url = "http://127.0.0.1:8080"
client = Client(endpoint_url)

image = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/0052a70beed5bf71b92610a43a52df6d286cd5f3/diffusers/rabbit.jpg"
prompt = f"""<|begin_of_text|><|start_header_id|>user<|end_header_id|>

![]({image})If I had to write a haiku for this one, it would be: <|eot_id|><|start_header_id|>assistant<|end_header_id|>"""

for resp in client.generate_stream(
    prompt,
    max_new_tokens=50,
    temperature=1,
):
    if not resp.token.special:
        print(resp.token.text, sep="", end="", flush=True)

Copy link
Contributor

@arnavgarg1 arnavgarg1 left a comment

Choose a reason for hiding this comment

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

Amazing :shipit:

@tgaddair tgaddair merged commit 3584a30 into main Sep 30, 2024
@tgaddair tgaddair deleted the mllama branch September 30, 2024 19:12
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