Spaces:
Running
Running
made changes in response
Browse files
app.py
CHANGED
@@ -158,21 +158,25 @@ def perform_inference(file_paths: Dict[str, str]):
|
|
158 |
context = aadhar_model
|
159 |
processor = processor_aadhar
|
160 |
name = "aadhar"
|
|
|
161 |
|
162 |
if doc_type == "pan_file":
|
163 |
context = pan_model
|
164 |
processor = processor_pan
|
165 |
name = "pan"
|
|
|
166 |
|
167 |
if doc_type == "gst_file":
|
168 |
context = gst_model
|
169 |
processor = processor_gst
|
170 |
name = "gst"
|
|
|
171 |
|
172 |
if doc_type == "cheque_file":
|
173 |
context = cheque_model
|
174 |
processor = processor_cheque
|
175 |
name = "cheque"
|
|
|
176 |
|
177 |
|
178 |
|
@@ -180,7 +184,7 @@ def perform_inference(file_paths: Dict[str, str]):
|
|
180 |
result = handle(inference_batch, context,processor,name)
|
181 |
|
182 |
# Store the result
|
183 |
-
inference_results[
|
184 |
else:
|
185 |
print(f"Model directory not found for {doc_type}. Skipping.")
|
186 |
|
|
|
158 |
context = aadhar_model
|
159 |
processor = processor_aadhar
|
160 |
name = "aadhar"
|
161 |
+
attachemnt_num = 3
|
162 |
|
163 |
if doc_type == "pan_file":
|
164 |
context = pan_model
|
165 |
processor = processor_pan
|
166 |
name = "pan"
|
167 |
+
attachemnt_num = 2
|
168 |
|
169 |
if doc_type == "gst_file":
|
170 |
context = gst_model
|
171 |
processor = processor_gst
|
172 |
name = "gst"
|
173 |
+
attachemnt_num = 4
|
174 |
|
175 |
if doc_type == "cheque_file":
|
176 |
context = cheque_model
|
177 |
processor = processor_cheque
|
178 |
name = "cheque"
|
179 |
+
attachemnt_num = 8
|
180 |
|
181 |
|
182 |
|
|
|
184 |
result = handle(inference_batch, context,processor,name)
|
185 |
|
186 |
# Store the result
|
187 |
+
inference_results["attachment_{}".format(attachemnt_num)] = result
|
188 |
else:
|
189 |
print(f"Model directory not found for {doc_type}. Skipping.")
|
190 |
|