🏡 index : github.com/compromyse/enfold.git

author Raghuram Subramani <raghus2247@gmail.com> 2025-04-07 7:12:53.0 +00:00:00
committer Raghuram Subramani <raghus2247@gmail.com> 2025-04-07 7:12:53.0 +00:00:00
commit
c0e8c7938ff52fa8c3ed4dc6f9079228a75bd345 [patch]
tree
1736770ec6447f43c11a1be96b0a6d62c29f47cd
parent
24ea17819efdd4d3ab19271c7a1f277cc7490277
download
c0e8c7938ff52fa8c3ed4dc6f9079228a75bd345.tar.gz

remove comment



Diff

 heinous_offences/app.py | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

diff --git a/heinous_offences/app.py b/heinous_offences/app.py
index 7cec2bd..6d20b1d 100644
--- a/heinous_offences/app.py
+++ a/heinous_offences/app.py
@@ -34,14 +34,13 @@
    results = table.search(crime_query.section == str(section))

    if not results:
        return f"No record found for section {section} under {name_from_key.get(act_key)}.", "", "", ""
        return f"No record found for section {section} under {act_key}.", "", "", ""

    offence = results[0]
    return [
        f"## Severity: {offence.get('severity', 'N/A')}",
        f"{offence.get('section_text', 'N/A')}",
        f"### Minimum Punishment: {offence.get('minimum_punishment', 'N/A')}",
        f"Comments: {offence.get('comment', 'N/A')}"
        f"### Minimum Punishment: {offence.get('minimum_punishment', 'N/A')}"
    ]

gradio_ui = gr.Blocks()
@@ -56,12 +55,11 @@
    severity = gr.Markdown()
    section_text = gr.Markdown()
    punishment = gr.Markdown()
    comment = gr.Markdown()

    submit_btn.click(
        fn=lookup_crime,
        inputs=[section_input, act_dropdown],
        outputs=[severity, section_text, punishment, comment]
        outputs=[severity, section_text, punishment]
    )

# ---------- FastAPI Logic ----------
@@ -122,14 +120,13 @@
        reader = csv.reader(f)
        next(reader)
        for row in reader:
            if len(row) < 5:
            if len(row) < 4:
                continue
            table.insert({
                "section": row[0],
                "section_text": row[1],
                "minimum_punishment": row[2],
                "severity": row[3],
                "comment": row[4],
                "severity": row[3]
            })

    return RedirectResponse("/admin", status_code=303)