Spaces:
Running
on
Zero
Running
on
Zero
fix prompt bug
Browse files- tools/conversation.py +2 -1
tools/conversation.py
CHANGED
@@ -47,7 +47,7 @@ def get_prompt(conv):
|
|
47 |
else:
|
48 |
ret += conv.sep1
|
49 |
else:
|
50 |
-
ret += role + ":"
|
51 |
return ret
|
52 |
|
53 |
|
@@ -104,6 +104,7 @@ class Chat:
|
|
104 |
print(f"Prompt: {prompt}", flush=True)
|
105 |
|
106 |
inputs = self.processor(prompt, images=images, edit_prompt=False, return_prompt=False)
|
|
|
107 |
inputs = {k:v.to(self.device) for k,v in inputs.items() if v is not None}
|
108 |
return inputs, conv, images
|
109 |
|
|
|
47 |
else:
|
48 |
ret += conv.sep1
|
49 |
else:
|
50 |
+
ret += role + ": "
|
51 |
return ret
|
52 |
|
53 |
|
|
|
104 |
print(f"Prompt: {prompt}", flush=True)
|
105 |
|
106 |
inputs = self.processor(prompt, images=images, edit_prompt=False, return_prompt=False)
|
107 |
+
# print(self.processor.tokenizer.convert_ids_to_tokens(inputs['input_ids'][0]))
|
108 |
inputs = {k:v.to(self.device) for k,v in inputs.items() if v is not None}
|
109 |
return inputs, conv, images
|
110 |
|