Spaces:
Sleeping
Sleeping
fixes some bugs
Browse files- app.py +1 -1
- src/htr_pipeline/inferencer.py +1 -1
- tabs/stepwise_htr_tool.py +1 -1
app.py
CHANGED
@@ -118,7 +118,7 @@ print(job.result())
|
|
118 |
demo.load(None, None, None, _js=js)
|
119 |
|
120 |
|
121 |
-
demo.queue(max_size=
|
122 |
|
123 |
|
124 |
if __name__ == "__main__":
|
|
|
118 |
demo.load(None, None, None, _js=js)
|
119 |
|
120 |
|
121 |
+
demo.queue(concurrency_count=1, max_size=2)
|
122 |
|
123 |
|
124 |
if __name__ == "__main__":
|
src/htr_pipeline/inferencer.py
CHANGED
@@ -113,7 +113,7 @@ class Inferencer:
|
|
113 |
@timer_func
|
114 |
def transcribe(self, line_cropped):
|
115 |
result_rec = self.htr_model_inferencer(line_cropped)
|
116 |
-
return result_rec["predictions"][0]["text"], result_rec["predictions"][0]["scores"]
|
117 |
|
118 |
# def transcribe_different_model(self, image):
|
119 |
# processor = TrOCRProcessor.from_pretrained("microsoft/trocr-base-handwritten")
|
|
|
113 |
@timer_func
|
114 |
def transcribe(self, line_cropped):
|
115 |
result_rec = self.htr_model_inferencer(line_cropped)
|
116 |
+
return result_rec["predictions"][0]["text"], round(result_rec["predictions"][0]["scores"], 4)
|
117 |
|
118 |
# def transcribe_different_model(self, image):
|
119 |
# processor = TrOCRProcessor.from_pretrained("microsoft/trocr-base-handwritten")
|
tabs/stepwise_htr_tool.py
CHANGED
@@ -238,7 +238,7 @@ with gr.Blocks() as stepwise_htr_tool_tab:
|
|
238 |
with gr.Column(scale=1, visible=True):
|
239 |
mapping_dict = gr.Variable()
|
240 |
transcribed_text_df_finish = gr.Dataframe(
|
241 |
-
headers=["Transcribed text", "
|
242 |
max_rows=15,
|
243 |
col_count=(2, "fixed"),
|
244 |
wrap=True,
|
|
|
238 |
with gr.Column(scale=1, visible=True):
|
239 |
mapping_dict = gr.Variable()
|
240 |
transcribed_text_df_finish = gr.Dataframe(
|
241 |
+
headers=["Transcribed text", "Pred score"],
|
242 |
max_rows=15,
|
243 |
col_count=(2, "fixed"),
|
244 |
wrap=True,
|