We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
4.47.1
vision models: @amyeroberts, @qubvel
examples
transformers/src/transformers/models/llava_next/modeling_llava_next.py
Lines 866 to 916 in 5cabc75
def main(): args = parse_args() processor = LlavaNextProcessor.from_pretrained("llava-hf/llava-v1.6-mistral-7b-hf") model = LlavaNextForConditionalGeneration.from_pretrained( "llava-hf/llava-v1.6-mistral-7b-hf", torch_dtype=torch.float16, low_cpu_mem_usage=True, attn_implementation="flash_attention_2", ).to("cuda:0") setup_model_with_compression(model, args) url = "https://github.com/haotian-liu/LLaVA/blob/1a91fc274d7c35a9b50b3cb29c4247ae5837ce39/images/llava_v1_5_radar.jpg?raw=true" image = Image.open(requests.get(url, stream=True).raw) conversation = [ { "role": "user", "content": [ {"type": "image"}, {"type": "text", "text": "What is shown in this image?"}, ], }, ] prompt = processor.apply_chat_template(conversation, add_generation_prompt=True) inputs = processor(image, prompt, return_tensors="pt").to("cuda:0") output = model.generate(**inputs, max_new_tokens=100) print(processor.decode(output[0], skip_special_tokens=True))
how does the legacy processing work? can I disable it ?
The text was updated successfully, but these errors were encountered:
cc @zucchini-nlp as well
Sorry, something went wrong.
No branches or pull requests
System Info
4.47.1
Who can help?
vision models: @amyeroberts, @qubvel
Information
Tasks
examples
folder (such as GLUE/SQuAD, ...)Reproduction
transformers/src/transformers/models/llava_next/modeling_llava_next.py
Lines 866 to 916 in 5cabc75
Sample script
Expected behavior
how does the legacy processing work? can I disable it ?
The text was updated successfully, but these errors were encountered: