Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -86,7 +86,7 @@ def send_chat_message(user_message, chat_history, report_text, crumbs_text):
|
|
| 86 |
updated_history = chat_history + [[user_message, answer]]
|
| 87 |
return updated_history, ""
|
| 88 |
|
| 89 |
-
def fine_tune_report(openai_api_key: str, serpapi_api_key: str, report_html: str, initial_request: str, qa: str,
|
| 90 |
target_style: str, knowledge_crumbs: str, complementary_guidance: str) -> (str, str):
|
| 91 |
# Set API keys in environment variables.
|
| 92 |
os.environ["OPENAI_API_KEY"] = openai_api_key
|
|
@@ -114,6 +114,9 @@ Please provide three pieces of information in a JSON object with exactly three f
|
|
| 114 |
Report HTML:
|
| 115 |
{report_html}
|
| 116 |
|
|
|
|
|
|
|
|
|
|
| 117 |
Analyze it in regard to the initial request:
|
| 118 |
{initial_request}
|
| 119 |
Complementary guidance:
|
|
@@ -2758,7 +2761,9 @@ def main():
|
|
| 2758 |
with gr.Accordion("5] Report", open=False, elem_classes="folder"):
|
| 2759 |
progress_display = gr.Markdown("", elem_id="progress-display")
|
| 2760 |
run_btn = gr.Button("Generate report")
|
| 2761 |
-
|
|
|
|
|
|
|
| 2762 |
final_report = gr.HTML(label="Final Report", max_height = 800, min_height = 200)
|
| 2763 |
with gr.Accordion("Generate PDF", open=False, elem_classes="folder"):
|
| 2764 |
with gr.Column():
|
|
@@ -2837,7 +2842,7 @@ def main():
|
|
| 2837 |
|
| 2838 |
fine_tune_button.click(
|
| 2839 |
fn=fine_tune_report,
|
| 2840 |
-
inputs=[openai_api_key_input, serpapi_api_key_input, final_report, research_query, clarification_text, reportstyle, crumbs_box, additional_clarifications],
|
| 2841 |
outputs=[final_report, clarification_text]
|
| 2842 |
)
|
| 2843 |
|
|
|
|
| 86 |
updated_history = chat_history + [[user_message, answer]]
|
| 87 |
return updated_history, ""
|
| 88 |
|
| 89 |
+
def fine_tune_report(adjustmentguidelines: str, openai_api_key: str, serpapi_api_key: str, report_html: str, initial_request: str, qa: str,
|
| 90 |
target_style: str, knowledge_crumbs: str, complementary_guidance: str) -> (str, str):
|
| 91 |
# Set API keys in environment variables.
|
| 92 |
os.environ["OPENAI_API_KEY"] = openai_api_key
|
|
|
|
| 114 |
Report HTML:
|
| 115 |
{report_html}
|
| 116 |
|
| 117 |
+
Specific request from user on adjustments to perform (if provided):
|
| 118 |
+
{adjustmentguidelines}
|
| 119 |
+
|
| 120 |
Analyze it in regard to the initial request:
|
| 121 |
{initial_request}
|
| 122 |
Complementary guidance:
|
|
|
|
| 2761 |
with gr.Accordion("5] Report", open=False, elem_classes="folder"):
|
| 2762 |
progress_display = gr.Markdown("", elem_id="progress-display")
|
| 2763 |
run_btn = gr.Button("Generate report")
|
| 2764 |
+
with gr.Row():
|
| 2765 |
+
adjustmentguidelines = gr.Textbox(label="Improvement instructions", placeholder="Input here your directions.", lines=1)
|
| 2766 |
+
fine_tune_button = gr.Button("Improve the Report")
|
| 2767 |
final_report = gr.HTML(label="Final Report", max_height = 800, min_height = 200)
|
| 2768 |
with gr.Accordion("Generate PDF", open=False, elem_classes="folder"):
|
| 2769 |
with gr.Column():
|
|
|
|
| 2842 |
|
| 2843 |
fine_tune_button.click(
|
| 2844 |
fn=fine_tune_report,
|
| 2845 |
+
inputs=[adjustmentguidelines, openai_api_key_input, serpapi_api_key_input, final_report, research_query, clarification_text, reportstyle, crumbs_box, additional_clarifications],
|
| 2846 |
outputs=[final_report, clarification_text]
|
| 2847 |
)
|
| 2848 |
|