Spaces:
Running
Running
worksheet_edit_button = gr.Button("編輯", size="sm", variant="primary")
Browse files
app.py
CHANGED
@@ -1775,6 +1775,14 @@ def update_LLM_content(video_id, new_content, kind):
|
|
1775 |
questions_answers_text = json.dumps(questions_answers_json, ensure_ascii=False, indent=2)
|
1776 |
GCS_SERVICE.upload_json_string(bucket_name, blob_name, questions_answers_text)
|
1777 |
updated_content = questions_answers_text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1778 |
|
1779 |
print(f"{kind} 已更新到GCS")
|
1780 |
return gr.update(value=updated_content, interactive=False)
|
@@ -3079,8 +3087,8 @@ with gr.Blocks(theme=gr.themes.Base(primary_hue=gr.themes.colors.orange, seconda
|
|
3079 |
with gr.Row() as worksheet_admin:
|
3080 |
worksheet_kind = gr.Textbox(value="ai_content_list", show_label=False)
|
3081 |
worksheet_get_button = gr.Button("取得", size="sm", variant="primary")
|
3082 |
-
worksheet_edit_button = gr.Button("編輯
|
3083 |
-
worksheet_update_button = gr.Button("儲存
|
3084 |
worksheet_delete_button = gr.Button("刪除", size="sm", variant="primary")
|
3085 |
worksheet_create_button = gr.Button("重建(X)", size="sm", variant="primary", interactive=False)
|
3086 |
with gr.Row():
|
|
|
1775 |
questions_answers_text = json.dumps(questions_answers_json, ensure_ascii=False, indent=2)
|
1776 |
GCS_SERVICE.upload_json_string(bucket_name, blob_name, questions_answers_text)
|
1777 |
updated_content = questions_answers_text
|
1778 |
+
elif kind == "ai_content_list":
|
1779 |
+
if isinstance(new_content, str):
|
1780 |
+
ai_content_json = json.loads(new_content)
|
1781 |
+
else:
|
1782 |
+
ai_content_json = new_content
|
1783 |
+
ai_content_text = json.dumps(ai_content_json, ensure_ascii=False, indent=2)
|
1784 |
+
GCS_SERVICE.upload_json_string(bucket_name, blob_name, ai_content_text)
|
1785 |
+
updated_content = ai_content_text
|
1786 |
|
1787 |
print(f"{kind} 已更新到GCS")
|
1788 |
return gr.update(value=updated_content, interactive=False)
|
|
|
3087 |
with gr.Row() as worksheet_admin:
|
3088 |
worksheet_kind = gr.Textbox(value="ai_content_list", show_label=False)
|
3089 |
worksheet_get_button = gr.Button("取得", size="sm", variant="primary")
|
3090 |
+
worksheet_edit_button = gr.Button("編輯", size="sm", variant="primary")
|
3091 |
+
worksheet_update_button = gr.Button("儲存", size="sm", variant="primary")
|
3092 |
worksheet_delete_button = gr.Button("刪除", size="sm", variant="primary")
|
3093 |
worksheet_create_button = gr.Button("重建(X)", size="sm", variant="primary", interactive=False)
|
3094 |
with gr.Row():
|