Spaces:
Sleeping
Sleeping
Update manabCQgenetaion.py
Browse files- manabCQgenetaion.py +1 -21
manabCQgenetaion.py
CHANGED
|
@@ -7,9 +7,6 @@ import os
|
|
| 7 |
import re
|
| 8 |
import pandas as pd
|
| 9 |
|
| 10 |
-
import io
|
| 11 |
-
from flask import send_file
|
| 12 |
-
|
| 13 |
|
| 14 |
|
| 15 |
def normalize_text(s: str) -> str:
|
|
@@ -148,23 +145,6 @@ def compliance_import_OEM(manabfile: str, client):
|
|
| 148 |
classes='table table-striped table-bordered table-hover',
|
| 149 |
table_id='extraction-table'
|
| 150 |
)
|
| 151 |
-
@app.route("/download-extraction")
|
| 152 |
-
def download_extraction():
|
| 153 |
-
output = io.BytesIO()
|
| 154 |
-
with pd.ExcelWriter(output, engine="xlsxwriter") as writer:
|
| 155 |
-
extraction_df.to_excel(writer, index=False, sheet_name="Extraction")
|
| 156 |
-
output.seek(0)
|
| 157 |
-
return send_file(
|
| 158 |
-
output,
|
| 159 |
-
as_attachment=True,
|
| 160 |
-
download_name="extraction.xlsx", # Flask >= 2.0
|
| 161 |
-
mimetype="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
|
| 162 |
-
)
|
| 163 |
-
extraction_html+=f"""
|
| 164 |
-
<a href="/download-extraction" class="btn btn-primary" download>
|
| 165 |
-
Download as Excel
|
| 166 |
-
</a>
|
| 167 |
-
"""
|
| 168 |
compliance_html = compliance_df.to_html(
|
| 169 |
index=False,
|
| 170 |
escape=False,
|
|
@@ -186,4 +166,4 @@ def compliance_import_OEM(manabfile: str, client):
|
|
| 186 |
#print (result_dic["extraction"]["Dispatch point"])
|
| 187 |
#print(result_dic["compliance_check"][0]['rule_heading'])
|
| 188 |
|
| 189 |
-
return
|
|
|
|
| 7 |
import re
|
| 8 |
import pandas as pd
|
| 9 |
|
|
|
|
|
|
|
|
|
|
| 10 |
|
| 11 |
|
| 12 |
def normalize_text(s: str) -> str:
|
|
|
|
| 145 |
classes='table table-striped table-bordered table-hover',
|
| 146 |
table_id='extraction-table'
|
| 147 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 148 |
compliance_html = compliance_df.to_html(
|
| 149 |
index=False,
|
| 150 |
escape=False,
|
|
|
|
| 166 |
#print (result_dic["extraction"]["Dispatch point"])
|
| 167 |
#print(result_dic["compliance_check"][0]['rule_heading'])
|
| 168 |
|
| 169 |
+
return extraction_item_value_html, extraction_html, compliance_html, input_tokens ,output_tokens, total_tokens, result_dic
|