Spaces:
Running on Zero
Running on Zero
Update llava_llama3/serve/cli.py
Browse files25 unmodified lines2627282930313230 unmodified lines6364656667686925 unmodified linesreturn imagedef chat_llava(args, image_file, text, tokenizer, model, image_processor, context_len):# Modeldisable_torch_init()30 unmodified linesinput_ids = tokenizer_image_token(prompt, tokenizer, IMAGE_TOKEN_INDEX, return_tensors='pt').unsqueeze(0).to(model.device)stop_str = conv.sep if conv.sep_style != SeparatorStyle.TWO else conv.sep2keywords = [stop_str]streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)with torch.inference_mode():output_ids = model.generate(25 unmodified lines2627282930313230 unmodified lines6364656667686925 unmodified linesreturn imagedef chat_llava(args, image_file, text, tokenizer, model, streamer, image_processor, context_len):# Modeldisable_torch_init()30 unmodified linesinput_ids = tokenizer_image_token(prompt, tokenizer, IMAGE_TOKEN_INDEX, return_tensors='pt').unsqueeze(0).to(model.device)stop_str = conv.sep if conv.sep_style != SeparatorStyle.TWO else conv.sep2keywords = [stop_str]# streamer = TextStreamer(tokenizer, skip_prompt=True, skip_special_tokens=True)with torch.inference_mode():output_ids = model.generate(
llava_llama3/serve/cli.py+2-2