seiching commited on
Commit
494d547
1 Parent(s): 9282cfe

add summary procedure

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -49,7 +49,7 @@ def call_openai_summary(openaiobj,transcription):
49
  messages=[
50
  {
51
  "role": "system",
52
- "content": "你是專業的文書處理員,請根據由語音辨識軟體將會議錄音所轉錄的逐字稿,摘錄重點,要用比較正式及容易閱讀的寫法,避免口語化"
53
  },
54
  {
55
  "role": "user",
@@ -94,8 +94,8 @@ def process_chunks(openaikeystr,inputtext):
94
  i=i+1
95
  # response=response+call_openai_summary(openaiobj,chunk)
96
 
97
- #finalresponse=response+' summary \n\n' +call_openai_api(openaiobj,response)
98
- return response
99
  # # Processes chunks in parallel
100
  # with ThreadPoolExecutor() as executor:
101
  # responses = list(executor.map(call_openai_api, [openaiobj,chunks]))
@@ -231,7 +231,7 @@ ainotes = gr.Interface(
231
  theme="huggingface",
232
  title="會議紀錄小幫手AINotes",
233
  description=(
234
- "可由麥克風錄音或上傳語音檔若有逐字稿可以直接貼在逐字稿"
235
  f" 使用這個模型 [{MODEL_NAME}](https://huggingface.co/{MODEL_NAME}) 先做語音辨識再做會議紀錄摘要"
236
  " 長度沒有限制"
237
  ),
 
49
  messages=[
50
  {
51
  "role": "system",
52
+ "content": "你是專業的會議紀錄製作員,請根據分段的會議決證,彙整成正式會議紀錄"
53
  },
54
  {
55
  "role": "user",
 
94
  i=i+1
95
  # response=response+call_openai_summary(openaiobj,chunk)
96
 
97
+ finalresponse=response+'\n\n summary \n\n' +call_openai_api(openaiobj,response)
98
+ return finalresponse
99
  # # Processes chunks in parallel
100
  # with ThreadPoolExecutor() as executor:
101
  # responses = list(executor.map(call_openai_api, [openaiobj,chunks]))
 
231
  theme="huggingface",
232
  title="會議紀錄小幫手AINotes",
233
  description=(
234
+ "可由麥克風錄音或上傳語音檔,並將本逐字稿欄位清空,若有逐字稿可以直接貼在逐字稿"
235
  f" 使用這個模型 [{MODEL_NAME}](https://huggingface.co/{MODEL_NAME}) 先做語音辨識再做會議紀錄摘要"
236
  " 長度沒有限制"
237
  ),