ttt-tkmr commited on
Commit
d43e471
1 Parent(s): 1bf475c

update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -6
app.py CHANGED
@@ -144,19 +144,30 @@ def gemini(api_key, input_file, meeting_name, members, point, keyword, model, ta
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
 
 
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
+
 
 
148
 
149
  # 音声 or 動画
150
  if task == "audio":
151
  system_prompt = audio_system_prompt(meeting_name, members, point, keyword)
152
+
153
+ # 処理の実行
154
+ chat_session = model_settings(api_key, system_prompt, model)
155
+ logging.warning(f"input file: {input_file}")
156
+ upload_file = genai.upload_file(input_file)
157
+ logging.warning(f"upload file: {upload_file}")
158
+ time.sleep(15)
159
+
160
  else:
161
+
162
  system_prompt = video_system_prompt(meeting_name, members, point, keyword)
163
+ # 処理の実行
164
+ chat_session = model_settings(api_key, system_prompt, model)
165
+ logging.warning(f"input file: {input_file}")
166
+ upload_file = genai.upload_file(input_file)
167
+ logging.warning(f"upload file: {upload_file}")
168
+ time.sleep(45)
169
 
170
+
 
171
 
172
  response = chat_session.send_message([upload_file])
173