Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -100,16 +100,7 @@ def abstractiveSummaryWithPegasus(words):
|
|
100 |
return actual_summ
|
101 |
|
102 |
|
103 |
-
# Main
|
104 |
-
def process(uri, mode):
|
105 |
-
if mode == "Youtube":
|
106 |
-
return YTVideoToText(uri)
|
107 |
-
elif mode == "Blog":
|
108 |
-
return postSummaryWithBart(uri)
|
109 |
-
else:
|
110 |
-
raise ValueError("Invalid mode")
|
111 |
-
|
112 |
-
|
113 |
with gr.Blocks() as ui:
|
114 |
gr.Markdown("""
|
115 |
## Permet de faire le rΓ©sumΓ© d'une video youtube ou d'un article de blog
|
@@ -136,14 +127,15 @@ with gr.Blocks() as ui:
|
|
136 |
api_name="resume"
|
137 |
)
|
138 |
with gr.Column():
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
|
|
143 |
)
|
144 |
-
gr.Button("Process
|
145 |
-
fn=
|
146 |
-
inputs=[URI
|
147 |
outputs=[TRANSCRIPT, RESUME],
|
148 |
api_name="process_uri"
|
149 |
)
|
|
|
100 |
return actual_summ
|
101 |
|
102 |
|
103 |
+
# Main UI
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
104 |
with gr.Blocks() as ui:
|
105 |
gr.Markdown("""
|
106 |
## Permet de faire le rΓ©sumΓ© d'une video youtube ou d'un article de blog
|
|
|
127 |
api_name="resume"
|
128 |
)
|
129 |
with gr.Column():
|
130 |
+
gr.Button("Process Youtube").click(
|
131 |
+
fn=YTVideoToText,
|
132 |
+
inputs=[URI],
|
133 |
+
outputs=[TRANSCRIPT, RESUME],
|
134 |
+
api_name="process_uri"
|
135 |
)
|
136 |
+
gr.Button("Process HTML").click(
|
137 |
+
fn=postSummaryWithBart,
|
138 |
+
inputs=[URI],
|
139 |
outputs=[TRANSCRIPT, RESUME],
|
140 |
api_name="process_uri"
|
141 |
)
|