ttt-tkmr commited on
Commit
802caeb
1 Parent(s): ab3d6fd

timer追加

Browse files
Files changed (1) hide show
  1. app.py +10 -7
app.py CHANGED
@@ -143,18 +143,21 @@ def gemini(api_key, input_file, meeting_name, members, point, keyword, model, ta
143
  raise gr.Error("No api_key submitted!")
144
  if input_file is None:
145
  raise gr.Error("No input_file submitted! Please upload or record an file before submitting your request.")
 
 
 
 
 
146
  # 音声 or 動画
147
  if task == "audio":
148
  system_prompt = audio_system_prompt(meeting_name, members, point, keyword)
149
  else:
 
150
  system_prompt = video_system_prompt(meeting_name, members, point, keyword)
151
 
152
  # 処理の実行
153
  chat_session = model_settings(api_key, system_prompt, model)
154
- logging.warning(f"input file: {input_file}")
155
- upload_file = genai.upload_file(input_file)
156
- logging.warning(f"upload file: {upload_file}")
157
-
158
  response = chat_session.send_message([upload_file])
159
 
160
  upload_file.delete()
@@ -175,7 +178,7 @@ audio = gr.Interface(
175
  gr.Textbox(value="audio", visible=False),
176
  ],
177
  outputs=[gr.Chatbot(show_copy_button=True, render_markdown=True, height=1000, value=[[None, demo_markdown]])],
178
- title="QuickRecap v1",
179
  description ="↑select souce. It automatically summarizes meeting audio and video.",
180
  allow_flagging="never",
181
  )
@@ -193,7 +196,7 @@ video = gr.Interface(
193
  gr.Textbox(value="video", visible=False),
194
  ],
195
  outputs=[gr.Chatbot(show_copy_button=True, render_markdown=True, height=1000, value=[[None, demo_markdown]])],
196
- title="QuickRecap v1",
197
  description ="↑select souce. It automatically summarizes meeting audio and video.",
198
  allow_flagging="never",
199
  )
@@ -201,6 +204,6 @@ video = gr.Interface(
201
 
202
  demo = gr.Blocks()
203
  with demo:
204
- gr.TabbedInterface([audio, video], ["Audio", "Video"])
205
 
206
  demo.launch()
 
143
  raise gr.Error("No api_key submitted!")
144
  if input_file is None:
145
  raise gr.Error("No input_file submitted! Please upload or record an file before submitting your request.")
146
+
147
+ logging.warning(f"input file: {input_file}")
148
+ upload_file = genai.upload_file(input_file)
149
+ logging.warning(f"upload file: {upload_file}")
150
+
151
  # 音声 or 動画
152
  if task == "audio":
153
  system_prompt = audio_system_prompt(meeting_name, members, point, keyword)
154
  else:
155
+ time.sleep(45)
156
  system_prompt = video_system_prompt(meeting_name, members, point, keyword)
157
 
158
  # 処理の実行
159
  chat_session = model_settings(api_key, system_prompt, model)
160
+
 
 
 
161
  response = chat_session.send_message([upload_file])
162
 
163
  upload_file.delete()
 
178
  gr.Textbox(value="audio", visible=False),
179
  ],
180
  outputs=[gr.Chatbot(show_copy_button=True, render_markdown=True, height=1000, value=[[None, demo_markdown]])],
181
+ title="📝 QuickRecap v1",
182
  description ="↑select souce. It automatically summarizes meeting audio and video.",
183
  allow_flagging="never",
184
  )
 
196
  gr.Textbox(value="video", visible=False),
197
  ],
198
  outputs=[gr.Chatbot(show_copy_button=True, render_markdown=True, height=1000, value=[[None, demo_markdown]])],
199
+ title="📝 QuickRecap v1",
200
  description ="↑select souce. It automatically summarizes meeting audio and video.",
201
  allow_flagging="never",
202
  )
 
204
 
205
  demo = gr.Blocks()
206
  with demo:
207
+ gr.TabbedInterface([audio, video], ["🔈Audio", "🎥Video"])
208
 
209
  demo.launch()