gmoriki commited on
Commit
d59ee96
1 Parent(s): 2afbbf2

initial commit

Browse files
Files changed (2) hide show
  1. app.py +36 -0
  2. requirement.txt +1 -0
app.py ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import openai
3
+
4
+
5
+ def create_meeting_summary(openai_key, uploaded_audio):
6
+ openai.api_key = openai_key
7
+ transcript = openai.Audio.transcribe("whisper-1", open(uploaded_audio, "rb"))
8
+ system_template = """会議の書き起こしが渡されます。
9
+
10
+ この会議のサマリーをMarkdown形式で作成してください。サマリーは、以下のような形式で書いてください。
11
+
12
+ - 会議の目的
13
+ - 会議の内容
14
+ - 会議の結果"""
15
+
16
+ completion = openai.ChatCompletion.create(
17
+ model="gpt-3.5-turbo",
18
+ messages=[{"role": "system", "content": system_template}, {"role": "user", "content": transcript.text}],
19
+ )
20
+ response_text = completion.choices[0].message.content
21
+ return response_text
22
+
23
+
24
+ inputs = [gr.Textbox(lines=1, label="openai_key"), gr.Audio(type="filepath", label="音声ファイルをアップロード")]
25
+
26
+ outputs = gr.Textbox(label="会議サマリー")
27
+
28
+ app = gr.Interface(
29
+ fn=create_meeting_summary,
30
+ inputs=inputs,
31
+ outputs=outputs,
32
+ title="会議サマリー生成アプリ",
33
+ description="音声ファイルをアップロードして、会議のサマリーをMarkdown形式で作成します。",
34
+ )
35
+
36
+ app.launch(debug=True)
requirement.txt ADDED
@@ -0,0 +1 @@
 
 
1
+ openai==0.27.4