Spaces:
Runtime error
Runtime error
Download src/validator.py from jayanth-2005/output: direct link, hf CLI and curl.
- Browser
- Download file 332 Bytes
-
https://huggingface.co/spaces/jayanth-2005/output/resolve/main/src/validator.py
- Command line
-
hf download hf://spaces/jayanth-2005/output/src/validator.py
-
curl -L -o validator.py https://huggingface.co/spaces/jayanth-2005/output/resolve/main/src/validator.py
332 Bytes
| def validate(data): | |
| score = 100 | |
| calc_total = data["Taxable"] + data["CGST"] + data["SGST"] + data["IGST"] | |
| if abs(calc_total - data["Total"]) > 2: | |
| score -= 20 | |
| if not data["GSTIN"]: | |
| score -= 15 | |
| if not data["Invoice No"]: | |
| score -= 10 | |
| data["Confidence"] = f"{score}%" | |
| return data | |