mbCrypto commited on
Commit
edbb831
Β·
1 Parent(s): 198c7f7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -17
app.py CHANGED
@@ -100,16 +100,7 @@ def abstractiveSummaryWithPegasus(words):
100
  return actual_summ
101
 
102
 
103
- # Main logic of the program
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
- MODE = gr.Radio(
140
- label="Mode pour URI",
141
- choices=["Youtube", "Blog"],
142
- api_name="mode"
 
143
  )
144
- gr.Button("Process URI").click(
145
- fn=process,
146
- inputs=[URI, MODE],
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
  )