pragnakalp
commited on
Commit
•
8439022
1
Parent(s):
ec9af30
Update app.py
Browse files
app.py
CHANGED
@@ -30,6 +30,7 @@ import smtplib
|
|
30 |
# print("create folder--->")
|
31 |
|
32 |
HF_TOKEN1 = os.getenv('HF_TOKEN')
|
|
|
33 |
hf_writer = gr.HuggingFaceDatasetSaver(HF_TOKEN1, 'OCR-image-to-text')
|
34 |
def get_device_ip_address():
|
35 |
|
@@ -195,11 +196,12 @@ demo = gr.Interface(
|
|
195 |
generate_ocr,
|
196 |
[method,image],
|
197 |
output,
|
198 |
-
allow_flagging = "manual",
|
199 |
-
flagging_callback=hf_writer,
|
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 |
)
|
205 |
demo.launch(enable_queue = False)
|
|
|
30 |
# print("create folder--->")
|
31 |
|
32 |
HF_TOKEN1 = os.getenv('HF_TOKEN')
|
33 |
+
print(type(HF_TOKEN1))
|
34 |
hf_writer = gr.HuggingFaceDatasetSaver(HF_TOKEN1, 'OCR-image-to-text')
|
35 |
def get_device_ip_address():
|
36 |
|
|
|
196 |
generate_ocr,
|
197 |
[method,image],
|
198 |
output,
|
|
|
|
|
199 |
title="Optical Character Recognition",
|
200 |
description="Try OCR with different methods",
|
201 |
theme="darkpeach",
|
202 |
+
css=".gradio-container {background-color: lightgray} #radio_div {background-color: #FFD8B4; font-size: 40px;}",
|
203 |
+
allow_flagging = "manual",
|
204 |
+
flagging_dir = "flagged",
|
205 |
+
flagging_callback=hf_writer
|
206 |
)
|
207 |
demo.launch(enable_queue = False)
|