Upload folder using huggingface_hub
Browse files
README.md
CHANGED
|
@@ -295,7 +295,7 @@ video_path = './examples/red-panda.mp4'
|
|
| 295 |
pixel_values, num_patches_list = load_video(video_path, num_segments=8, max_num=1)
|
| 296 |
pixel_values = pixel_values.to(torch.bfloat16).cuda()
|
| 297 |
video_prefix = ''.join([f'Frame{i+1}: <image>\n' for i in range(len(num_patches_list))])
|
| 298 |
-
question = video_prefix + 'What is the red panda doing?
|
| 299 |
# Frame1: <image>\nFrame2: <image>\n...\nFrame31: <image>\n{question}
|
| 300 |
response, history = model.chat(tokenizer, pixel_values, question, generation_config,
|
| 301 |
num_patches_list=num_patches_list,
|
|
@@ -303,7 +303,7 @@ response, history = model.chat(tokenizer, pixel_values, question, generation_con
|
|
| 303 |
print(f'User: {question}')
|
| 304 |
print(f'Assistant: {response}')
|
| 305 |
|
| 306 |
-
question = 'Describe this video in detail. Don'
|
| 307 |
response, history = model.chat(tokenizer, pixel_values, question, generation_config,
|
| 308 |
num_patches_list=num_patches_list,
|
| 309 |
history=history, return_history=True)
|
|
|
|
| 295 |
pixel_values, num_patches_list = load_video(video_path, num_segments=8, max_num=1)
|
| 296 |
pixel_values = pixel_values.to(torch.bfloat16).cuda()
|
| 297 |
video_prefix = ''.join([f'Frame{i+1}: <image>\n' for i in range(len(num_patches_list))])
|
| 298 |
+
question = video_prefix + 'What is the red panda doing?'
|
| 299 |
# Frame1: <image>\nFrame2: <image>\n...\nFrame31: <image>\n{question}
|
| 300 |
response, history = model.chat(tokenizer, pixel_values, question, generation_config,
|
| 301 |
num_patches_list=num_patches_list,
|
|
|
|
| 303 |
print(f'User: {question}')
|
| 304 |
print(f'Assistant: {response}')
|
| 305 |
|
| 306 |
+
question = 'Describe this video in detail. Don\'t repeat.'
|
| 307 |
response, history = model.chat(tokenizer, pixel_values, question, generation_config,
|
| 308 |
num_patches_list=num_patches_list,
|
| 309 |
history=history, return_history=True)
|