Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -459,7 +459,7 @@ def generate_text_img_wrapper(args):
|
|
459 |
def generate_hidden_img_wrapper(args):
|
460 |
return render_next_token_table_image(*args)
|
461 |
|
462 |
-
@spaces.GPU
|
463 |
def generate_video(image, prompt, max_tokens):
|
464 |
print(image)
|
465 |
pixel_values, target_aspect_ratio = load_image(image, max_num=6)
|
@@ -467,7 +467,7 @@ def generate_video(image, prompt, max_tokens):
|
|
467 |
generation_config = dict(max_new_tokens= int(max_tokens), do_sample=False, num_beams = 3, repetition_penalty=2.5)
|
468 |
response, query = model.chat(tokenizer, pixel_values, '<image>\n'+prompt, generation_config, return_history=False, \
|
469 |
attention_visualize=True,last_visualize_layers=7,raw_image_path=image,target_aspect_ratio=target_aspect_ratio)
|
470 |
-
|
471 |
generation_output = response
|
472 |
raw_image_path = image
|
473 |
|
|
|
459 |
def generate_hidden_img_wrapper(args):
|
460 |
return render_next_token_table_image(*args)
|
461 |
|
462 |
+
@spaces.GPU(duration=120)
|
463 |
def generate_video(image, prompt, max_tokens):
|
464 |
print(image)
|
465 |
pixel_values, target_aspect_ratio = load_image(image, max_num=6)
|
|
|
467 |
generation_config = dict(max_new_tokens= int(max_tokens), do_sample=False, num_beams = 3, repetition_penalty=2.5)
|
468 |
response, query = model.chat(tokenizer, pixel_values, '<image>\n'+prompt, generation_config, return_history=False, \
|
469 |
attention_visualize=True,last_visualize_layers=7,raw_image_path=image,target_aspect_ratio=target_aspect_ratio)
|
470 |
+
|
471 |
generation_output = response
|
472 |
raw_image_path = image
|
473 |
|