luodian commited on
Commit
362b449
1 Parent(s): 20cefde

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +10 -11
README.md CHANGED
@@ -48,7 +48,7 @@ import transformers
48
  from PIL import Image
49
  import sys
50
 
51
- sys.path.append("..")
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 = "fp16"
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 = "/path/to/your_video.mp4" # Replace with the path to your video file, could be any common format.
178
 
179
  frames_list = get_image(video_url)
180
 
181
- prompts_input = input("Enter prompts (comma-separated): ")
182
- prompts = [prompt.strip() for prompt in prompts_input.split(",")]
183
 
184
- for prompt in prompts:
185
- print(f"\nPrompt: {prompt}")
186
- response = get_response(frames_list, prompt, model, image_processor, tensor_dtype)
187
- print(f"Response: {response}")
188
 
189
- if prompts_input.lower() == "quit":
190
- break
 
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
  ```