yalrashed commited on
Commit
641f97c
·
verified ·
1 Parent(s): edfc0ce

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -5
app.py CHANGED
@@ -53,7 +53,9 @@ def process_screenplay(pdf_file, progress=gr.Progress()):
53
  cleaned_text = f.read()
54
 
55
  progress(1.0, desc="Complete!")
56
- return [cleaned_text, str(cleaned_path), gr.update(interactive=True, variant="primary"),
 
 
57
  gr.update(interactive=True, variant="primary"),
58
  gr.update(interactive=False, variant="secondary"),
59
  gr.update(interactive=False, variant="secondary"),
@@ -82,7 +84,9 @@ def generate_coverage(progress=gr.Progress()):
82
  coverage = f.read()
83
 
84
  progress(1.0, desc="Complete!")
85
- return [coverage, str(coverage_path), console.get_output()]
 
 
86
 
87
  except Exception as e:
88
  error_msg = f"Error: {str(e)}"
@@ -107,7 +111,10 @@ def analyze_screenplay(progress=gr.Progress()):
107
  analysis = f.read()
108
 
109
  progress(1.0, desc="Complete!")
110
- return [analysis, str(analysis_path), gr.update(interactive=True, variant="primary"), console.get_output()]
 
 
 
111
 
112
  except Exception as e:
113
  error_msg = f"Error: {str(e)}"
@@ -132,7 +139,10 @@ def post_process_analysis(progress=gr.Progress()):
132
  analysis = f.read()
133
 
134
  progress(1.0, desc="Complete!")
135
- return [analysis, str(output_path), gr.update(interactive=True, variant="primary"), console.get_output()]
 
 
 
136
 
137
  except Exception as e:
138
  error_msg = f"Error: {str(e)}"
@@ -158,7 +168,9 @@ def generate_market_analysis(progress=gr.Progress()):
158
  analysis = f.read()
159
 
160
  progress(1.0, desc="Complete!")
161
- return [analysis, str(market_path), console.get_output()]
 
 
162
 
163
  except Exception as e:
164
  error_msg = f"Error: {str(e)}"
 
53
  cleaned_text = f.read()
54
 
55
  progress(1.0, desc="Complete!")
56
+ return [cleaned_text,
57
+ gr.update(value=str(cleaned_path), visible=True),
58
+ gr.update(interactive=True, variant="primary"),
59
  gr.update(interactive=True, variant="primary"),
60
  gr.update(interactive=False, variant="secondary"),
61
  gr.update(interactive=False, variant="secondary"),
 
84
  coverage = f.read()
85
 
86
  progress(1.0, desc="Complete!")
87
+ return [coverage,
88
+ gr.update(value=str(coverage_path), visible=True),
89
+ console.get_output()]
90
 
91
  except Exception as e:
92
  error_msg = f"Error: {str(e)}"
 
111
  analysis = f.read()
112
 
113
  progress(1.0, desc="Complete!")
114
+ return [analysis,
115
+ gr.update(value=str(analysis_path), visible=True),
116
+ gr.update(interactive=True, variant="primary"),
117
+ console.get_output()]
118
 
119
  except Exception as e:
120
  error_msg = f"Error: {str(e)}"
 
139
  analysis = f.read()
140
 
141
  progress(1.0, desc="Complete!")
142
+ return [analysis,
143
+ gr.update(value=str(output_path), visible=True),
144
+ gr.update(interactive=True, variant="primary"),
145
+ console.get_output()]
146
 
147
  except Exception as e:
148
  error_msg = f"Error: {str(e)}"
 
168
  analysis = f.read()
169
 
170
  progress(1.0, desc="Complete!")
171
+ return [analysis,
172
+ gr.update(value=str(market_path), visible=True),
173
+ console.get_output()]
174
 
175
  except Exception as e:
176
  error_msg = f"Error: {str(e)}"