pragnakalp
commited on
Commit
•
9697a0e
1
Parent(s):
68d2673
Update app.py
Browse files
app.py
CHANGED
@@ -31,7 +31,7 @@ import smtplib
|
|
31 |
|
32 |
HF_TOKEN = os.getenv("HF")
|
33 |
# name = 'pragnakalp-all-log'
|
34 |
-
|
35 |
print(os.getcwd())
|
36 |
def get_device_ip_address():
|
37 |
|
@@ -197,11 +197,11 @@ demo = gr.Interface(
|
|
197 |
generate_ocr,
|
198 |
[method,image],
|
199 |
output,
|
|
|
|
|
200 |
title="Optical Character Recognition",
|
201 |
description="Try OCR with different methods",
|
202 |
theme="darkpeach",
|
203 |
-
css=".gradio-container {background-color: lightgray} #radio_div {background-color: #FFD8B4; font-size: 40px;}"
|
204 |
-
allow_flagging = "manual",
|
205 |
-
flagging_callback = hf_write
|
206 |
)
|
207 |
demo.launch(enable_queue = False)
|
|
|
31 |
|
32 |
HF_TOKEN = os.getenv("HF")
|
33 |
# name = 'pragnakalp-all-log'
|
34 |
+
hf_writer = gr.HuggingFaceDatasetSaver(HF_TOKEN, 'OCR-image-to-text')
|
35 |
print(os.getcwd())
|
36 |
def get_device_ip_address():
|
37 |
|
|
|
197 |
generate_ocr,
|
198 |
[method,image],
|
199 |
output,
|
200 |
+
allow_flagging = "manual",
|
201 |
+
flagging_callback = hf_writer,
|
202 |
title="Optical Character Recognition",
|
203 |
description="Try OCR with different methods",
|
204 |
theme="darkpeach",
|
205 |
+
css=".gradio-container {background-color: lightgray} #radio_div {background-color: #FFD8B4; font-size: 40px;}"
|
|
|
|
|
206 |
)
|
207 |
demo.launch(enable_queue = False)
|