Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -114,7 +114,7 @@ def respond(message, history):
|
|
| 114 |
#answer = qa_chain.invoke(message)
|
| 115 |
docs = retriever.invoke(message)
|
| 116 |
refs = [f"Page {d.metadata.get('page', 'N/A')}" for d in docs]
|
| 117 |
-
full_answer = f"Input tokens: {cb.prompt_tokens}
|
| 118 |
|
| 119 |
# CRITICAL: Append ONLY pure dicts - no metadata, tuples, or extras
|
| 120 |
new_history = history + [ # Or history.append() then return history
|
|
@@ -334,8 +334,8 @@ def generateCqOemImport(file_name):
|
|
| 334 |
{extraction_html}
|
| 335 |
\n The compliance of the offer against our rules are as under. \n
|
| 336 |
{compliance_html}
|
| 337 |
-
\n
|
| 338 |
-
The
|
| 339 |
{kkk}
|
| 340 |
"""
|
| 341 |
yield dd
|
|
@@ -428,6 +428,6 @@ with gr.Blocks(css=css) as demo:
|
|
| 428 |
gr.HTML("""
|
| 429 |
<div style="color: white; background: black; padding: 20px; text-align: center; font-size: 24px;">
|
| 430 |
🚧 Coming Soon 🚧
|
| 431 |
-
</div>"""
|
| 432 |
)
|
| 433 |
demo.queue().launch()
|
|
|
|
| 114 |
#answer = qa_chain.invoke(message)
|
| 115 |
docs = retriever.invoke(message)
|
| 116 |
refs = [f"Page {d.metadata.get('page', 'N/A')}" for d in docs]
|
| 117 |
+
full_answer = f"Input tokens: {cb.prompt_tokens}, Ouput tokens: {cb.completion_tokens}, Total tokens: {cb.total_tokens}, Cost: ${cb.total_cost}\n{answer}\n\n**References:**\n" + "\n".join(refs)
|
| 118 |
|
| 119 |
# CRITICAL: Append ONLY pure dicts - no metadata, tuples, or extras
|
| 120 |
new_history = history + [ # Or history.append() then return history
|
|
|
|
| 334 |
{extraction_html}
|
| 335 |
\n The compliance of the offer against our rules are as under. \n
|
| 336 |
{compliance_html}
|
| 337 |
+
\n\n
|
| 338 |
+
The Draft CQ is as under: \n\n\n
|
| 339 |
{kkk}
|
| 340 |
"""
|
| 341 |
yield dd
|
|
|
|
| 428 |
gr.HTML("""
|
| 429 |
<div style="color: white; background: black; padding: 20px; text-align: center; font-size: 24px;">
|
| 430 |
🚧 Coming Soon 🚧
|
| 431 |
+
</div> """
|
| 432 |
)
|
| 433 |
demo.queue().launch()
|