Update app.py
Browse files
app.py
CHANGED
|
@@ -45,7 +45,7 @@ def process_screenplay(pdf_file, progress=gr.Progress()):
|
|
| 45 |
cleaned_text = f.read()
|
| 46 |
|
| 47 |
progress(1.0, desc="Complete!")
|
| 48 |
-
return cleaned_text,
|
| 49 |
|
| 50 |
except Exception as e:
|
| 51 |
error_msg = f"Error: {str(e)}"
|
|
@@ -104,10 +104,15 @@ with gr.Blocks(title="Screenplay Coverage Generator") as demo:
|
|
| 104 |
with gr.TabItem("Coverage"):
|
| 105 |
coverage_output = gr.Textbox(label="Coverage Document", lines=10, show_copy_button=True)
|
| 106 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 107 |
process_btn.click(
|
| 108 |
fn=process_screenplay,
|
| 109 |
inputs=[file_input],
|
| 110 |
-
outputs=[cleaned_output, coverage_btn, console]
|
|
|
|
| 111 |
)
|
| 112 |
|
| 113 |
coverage_btn.click(
|
|
|
|
| 45 |
cleaned_text = f.read()
|
| 46 |
|
| 47 |
progress(1.0, desc="Complete!")
|
| 48 |
+
return cleaned_text, True, console.get_output()
|
| 49 |
|
| 50 |
except Exception as e:
|
| 51 |
error_msg = f"Error: {str(e)}"
|
|
|
|
| 104 |
with gr.TabItem("Coverage"):
|
| 105 |
coverage_output = gr.Textbox(label="Coverage Document", lines=10, show_copy_button=True)
|
| 106 |
|
| 107 |
+
def update_coverage_btn(cleaned_text, interactive, console_out):
|
| 108 |
+
coverage_btn.interactive = interactive
|
| 109 |
+
return cleaned_text, console_out
|
| 110 |
+
|
| 111 |
process_btn.click(
|
| 112 |
fn=process_screenplay,
|
| 113 |
inputs=[file_input],
|
| 114 |
+
outputs=[cleaned_output, coverage_btn, console],
|
| 115 |
+
_js="() => {coverage_btn.interactive = true;}"
|
| 116 |
)
|
| 117 |
|
| 118 |
coverage_btn.click(
|