Spaces:
Running
Running
Update my_model/KBVQA.py
Browse files- my_model/KBVQA.py +1 -0
my_model/KBVQA.py
CHANGED
@@ -257,6 +257,7 @@ class KBVQA:
|
|
257 |
prompt = self.format_prompt(question, caption=caption, objects=detected_objects_str)
|
258 |
num_tokens = len(self.kbvqa_tokenizer.tokenize(prompt))
|
259 |
self.current_prompt_length = num_tokens
|
|
|
260 |
if self.current_prompt_length > self.max_context_window:
|
261 |
trim = True
|
262 |
st.warning(f"Prompt length is {self.current_prompt_length} which is larger than the maximum context window of LLaMA-2, objects detected with low confidence will be removed one at a time until the prompt length is within the maximum context window ...")
|
|
|
257 |
prompt = self.format_prompt(question, caption=caption, objects=detected_objects_str)
|
258 |
num_tokens = len(self.kbvqa_tokenizer.tokenize(prompt))
|
259 |
self.current_prompt_length = num_tokens
|
260 |
+
trim = False
|
261 |
if self.current_prompt_length > self.max_context_window:
|
262 |
trim = True
|
263 |
st.warning(f"Prompt length is {self.current_prompt_length} which is larger than the maximum context window of LLaMA-2, objects detected with low confidence will be removed one at a time until the prompt length is within the maximum context window ...")
|