Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -84,8 +84,8 @@ def generate_image(text: str, image: Image.Image,
|
|
84 |
text=[prompt_full],
|
85 |
images=[image],
|
86 |
return_tensors="pt",
|
87 |
-
padding=
|
88 |
-
truncation=
|
89 |
max_length=MAX_INPUT_TOKEN_LENGTH
|
90 |
).to("cuda")
|
91 |
streamer = TextIteratorStreamer(processor, skip_prompt=True, skip_special_tokens=True)
|
@@ -129,7 +129,7 @@ def generate_video(text: str, video_path: str,
|
|
129 |
add_generation_prompt=True,
|
130 |
return_dict=True,
|
131 |
return_tensors="pt",
|
132 |
-
truncation=
|
133 |
max_length=MAX_INPUT_TOKEN_LENGTH
|
134 |
).to("cuda")
|
135 |
streamer = TextIteratorStreamer(processor, skip_prompt=True, skip_special_tokens=True)
|
@@ -163,7 +163,6 @@ video_examples = [
|
|
163 |
["Identify the main actions in the video", "videos/2.mp4"]
|
164 |
]
|
165 |
|
166 |
-
|
167 |
css = """
|
168 |
.submit-btn {
|
169 |
background-color: #2980b9 !important;
|
|
|
84 |
text=[prompt_full],
|
85 |
images=[image],
|
86 |
return_tensors="pt",
|
87 |
+
padding='max_length',
|
88 |
+
truncation=True,
|
89 |
max_length=MAX_INPUT_TOKEN_LENGTH
|
90 |
).to("cuda")
|
91 |
streamer = TextIteratorStreamer(processor, skip_prompt=True, skip_special_tokens=True)
|
|
|
129 |
add_generation_prompt=True,
|
130 |
return_dict=True,
|
131 |
return_tensors="pt",
|
132 |
+
truncation=True,
|
133 |
max_length=MAX_INPUT_TOKEN_LENGTH
|
134 |
).to("cuda")
|
135 |
streamer = TextIteratorStreamer(processor, skip_prompt=True, skip_special_tokens=True)
|
|
|
163 |
["Identify the main actions in the video", "videos/2.mp4"]
|
164 |
]
|
165 |
|
|
|
166 |
css = """
|
167 |
.submit-btn {
|
168 |
background-color: #2980b9 !important;
|