video_bot_999 / app.py

Commit History

with gr.Blocks(js=JS, css=CSS) as demo:
799a8f8

youngtsai commited on

with gr.Tab("心智圖"):
62b7350

youngtsai commited on

{mind_map_markdown}
afee61a

youngtsai commited on

def get_mind_map_html(mind_map):
dddad30

youngtsai commited on

"model": "gpt-4-turbo-preview",
65300ff

youngtsai commited on

def get_video_id_summary(video_id, df_string):
7c59179

youngtsai commited on

send_question delete
7115eb8

youngtsai commited on

print(socratic_mode)
f7129ff

youngtsai commited on

最後,在你回答的開頭標註【蘇格拉底助教】
8bcb25f

youngtsai commited on

summary_json = {"summary": str(summary)}
f066645

youngtsai commited on

socratic_mode_btn = gr.Checkbox(label="蘇格拉底家教助理模式", value=False)
b5c6a12

youngtsai commited on

def get_questions(video_id, df_string):
2b5e430

youngtsai commited on

if not video_id:
79fc5f8

youngtsai commited on

get_video_id
bedad3b

youngtsai commited on

def get_questions(video_id, df_string):
f4b5a4c

youngtsai commited on

# print(f"TRANSCRIPTS: {TRANSCRIPTS}")
05867f4

youngtsai commited on

upload_content_directly
d770843

youngtsai commited on

summary_json = { "summary": str(summary.replace("\n","|")) }
2546c90

youngtsai commited on

print("Uploaded %d%%." % (status.progress() * 100))
20cf22c

youngtsai commited on

summary_json = { "summary": str(summary) }
b1488d9

youngtsai commited on

with open(f'{OUTPUT_PATH}/{video_id}_summary.json', 'w') as f:
38a8c25

youngtsai commited on

with io.BytesIO(content.encode('utf-8')) as fh:
143b0eb

youngtsai commited on

processed_summary = { "summary": str(summary) }
06d6aec

youngtsai commited on

summary_json
5fde70f

youngtsai commited on

JSON format 為 \{
071c658

youngtsai commited on

summarise_json
310a5fd

youngtsai commited on

fixbug processed_summary = str(summary)
3369173

youngtsai commited on

processed_summary = str(summary)
ebc4f25

youngtsai commited on

processed_summary
4981d63

youngtsai commited on

json_text = json_text.replace(":", "\\:")
cd72892

youngtsai commited on

def preprocess_text(text):
a795b54

youngtsai commited on

def preprocess_text(text):
dc5db85

youngtsai commited on

summary = generate_summarise(df_string)
e5a1f9f

youngtsai commited on

summary = "summary_summary_summary"
67879c8

youngtsai commited on

upload_content_directly
e992549

youngtsai commited on

get_video_id_summary
fb426cd

youngtsai commited on

# if chat_history is not none, append role, content to messages
57ecc14

youngtsai commited on

error_msg = f" {video_id} 逐字稿錯誤: {str(e)}"
9b999c7

youngtsai commited on

print("===get_video_id_summary error===")
3ef16c9

youngtsai commited on

raise gr.Error(error_msg)
75ac158

youngtsai commited on

user_content = f"請根據 {df_string} 生成三個問題,並用 JSON 格式返回 questions:[q1的敘述text, q2的敘述text, q3的敘述text]"
939f3b1

youngtsai commited on