nickgambirasi
commited on
Commit
·
12a5839
1
Parent(s):
2a0b298
prototype output
Browse files
app.py
CHANGED
@@ -40,8 +40,14 @@ def process_document(image):
|
|
40 |
sequence = processor.batch_decode(outputs.sequences)[0]
|
41 |
sequence = sequence.replace(processor.tokenizer.eos_token, "").replace(processor.tokenizer.pad_token, "")
|
42 |
sequence = re.sub(r"<.*?>", "", sequence, count=1).strip() # remove first task start token
|
|
|
|
|
43 |
|
44 |
-
return
|
|
|
|
|
|
|
|
|
45 |
|
46 |
demo = gradio.Interface(
|
47 |
fn=process_document,
|
|
|
40 |
sequence = processor.batch_decode(outputs.sequences)[0]
|
41 |
sequence = sequence.replace(processor.tokenizer.eos_token, "").replace(processor.tokenizer.pad_token, "")
|
42 |
sequence = re.sub(r"<.*?>", "", sequence, count=1).strip() # remove first task start token
|
43 |
+
|
44 |
+
processor.token2json(sequence)
|
45 |
|
46 |
+
return {
|
47 |
+
'text_requirements': 'all_pass',
|
48 |
+
'symbol_requirements': 'all_pass',
|
49 |
+
'language_requirements': 'all_pass'
|
50 |
+
}
|
51 |
|
52 |
demo = gradio.Interface(
|
53 |
fn=process_document,
|