Spaces:
Runtime error
Runtime error
ivelin
commited on
Commit
·
2ea9225
1
Parent(s):
cdbb363
fix: bugs
Browse filesSigned-off-by: ivelin <ivelin.eth@gmail.com>
app.py
CHANGED
@@ -46,12 +46,13 @@ def process_refexp(image: Image, prompt: str):
|
|
46 |
|
47 |
# postprocess
|
48 |
sequence = processor.batch_decode(outputs.sequences)[0]
|
49 |
-
print(fr"predicted decoder sequence: {sequence}")
|
50 |
sequence = sequence.replace(processor.tokenizer.eos_token, "").replace(
|
51 |
processor.tokenizer.pad_token, "")
|
52 |
# remove first task start token
|
53 |
sequence = re.sub(r"<.*?>", "", sequence, count=1).strip()
|
54 |
-
print(
|
|
|
55 |
bbox = processor.token2json(sequence)
|
56 |
print(f"predicted bounding box: {bbox}")
|
57 |
|
|
|
46 |
|
47 |
# postprocess
|
48 |
sequence = processor.batch_decode(outputs.sequences)[0]
|
49 |
+
print(fr"predicted decoder sequence: {html.escape(sequence)}")
|
50 |
sequence = sequence.replace(processor.tokenizer.eos_token, "").replace(
|
51 |
processor.tokenizer.pad_token, "")
|
52 |
# remove first task start token
|
53 |
sequence = re.sub(r"<.*?>", "", sequence, count=1).strip()
|
54 |
+
print(
|
55 |
+
fr"predicted decoder sequence before token2json: {html.escape(sequence)}")
|
56 |
bbox = processor.token2json(sequence)
|
57 |
print(f"predicted bounding box: {bbox}")
|
58 |
|