Update README.md
Browse files
README.md
CHANGED
@@ -48,7 +48,7 @@ import transformers
|
|
48 |
from PIL import Image
|
49 |
import sys
|
50 |
|
51 |
-
|
52 |
from otter.modeling_otter import OtterForConditionalGeneration
|
53 |
|
54 |
# Disable warnings
|
@@ -156,7 +156,7 @@ def get_response(input_data, prompt: str, model=None, image_processor=None, tens
|
|
156 |
|
157 |
|
158 |
# ------------------- Main Function -------------------
|
159 |
-
load_bit = "
|
160 |
if load_bit == "fp16":
|
161 |
precision = {"torch_dtype": torch.float16}
|
162 |
elif load_bit == "bf16":
|
@@ -174,19 +174,18 @@ image_processor = transformers.CLIPImageProcessor()
|
|
174 |
model.eval()
|
175 |
|
176 |
while True:
|
177 |
-
video_url = "
|
178 |
|
179 |
frames_list = get_image(video_url)
|
180 |
|
181 |
-
|
182 |
-
|
183 |
|
184 |
-
|
185 |
-
|
186 |
-
response = get_response(frames_list, prompt, model, image_processor, tensor_dtype)
|
187 |
-
print(f"Response: {response}")
|
188 |
|
189 |
-
|
190 |
-
|
|
|
191 |
|
192 |
```
|
|
|
48 |
from PIL import Image
|
49 |
import sys
|
50 |
|
51 |
+
# make sure you can properly access the otter folder
|
52 |
from otter.modeling_otter import OtterForConditionalGeneration
|
53 |
|
54 |
# Disable warnings
|
|
|
156 |
|
157 |
|
158 |
# ------------------- Main Function -------------------
|
159 |
+
load_bit = "fp32"
|
160 |
if load_bit == "fp16":
|
161 |
precision = {"torch_dtype": torch.float16}
|
162 |
elif load_bit == "bf16":
|
|
|
174 |
model.eval()
|
175 |
|
176 |
while True:
|
177 |
+
video_url = input("Enter video path: ") # Replace with the path to your video file, could be any common format.
|
178 |
|
179 |
frames_list = get_image(video_url)
|
180 |
|
181 |
+
while True:
|
182 |
+
prompts_input = input("Enter prompts: ")
|
183 |
|
184 |
+
if prompts_input.lower() == "quit":
|
185 |
+
break
|
|
|
|
|
186 |
|
187 |
+
print(f"\nPrompt: {prompts_input}")
|
188 |
+
response = get_response(frames_list, prompts_input, model, image_processor, tensor_dtype)
|
189 |
+
print(f"Response: {response}")
|
190 |
|
191 |
```
|