Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -28,7 +28,8 @@ def analyze_with_chatgpt(article, criteria):
|
|
| 28 |
return response.choices[0].message.content
|
| 29 |
|
| 30 |
# 執行五次獨立分析
|
| 31 |
-
def analyze_five_times(
|
|
|
|
| 32 |
results = []
|
| 33 |
for i in range(5):
|
| 34 |
try:
|
|
@@ -86,14 +87,16 @@ criteria_default = """請嚴格根據以下對各類型人格的定義,幫我
|
|
| 86 |
iface = gr.Interface(
|
| 87 |
fn=analyze_five_times,
|
| 88 |
inputs=[
|
| 89 |
-
gr.Textbox(label="
|
|
|
|
|
|
|
| 90 |
gr.Textbox(label="判斷標準", lines=15, value=criteria_default)
|
| 91 |
],
|
| 92 |
outputs=[
|
| 93 |
gr.Textbox(label=f"第{i+1}次分析結果") for i in range(5)
|
| 94 |
],
|
| 95 |
title="ChatGPT 人格分析工具(五次獨立呼叫)",
|
| 96 |
-
description="此工具會使用 GPT-4o 根據
|
| 97 |
)
|
| 98 |
|
| 99 |
# 執行主程式
|
|
|
|
| 28 |
return response.choices[0].message.content
|
| 29 |
|
| 30 |
# 執行五次獨立分析
|
| 31 |
+
def analyze_five_times(intro, income, project, criteria):
|
| 32 |
+
article = f"【自我介紹】\n{intro}\n\n【意外收入】\n{income}\n\n【專案管理】\n{project}"
|
| 33 |
results = []
|
| 34 |
for i in range(5):
|
| 35 |
try:
|
|
|
|
| 87 |
iface = gr.Interface(
|
| 88 |
fn=analyze_five_times,
|
| 89 |
inputs=[
|
| 90 |
+
gr.Textbox(label="自我介紹", lines=5, placeholder="請輸入自我介紹內容"),
|
| 91 |
+
gr.Textbox(label="意外收入", lines=5, placeholder="請描述一段與金錢或額外獲得有關的經驗"),
|
| 92 |
+
gr.Textbox(label="專案管理", lines=5, placeholder="請描述你主導或參與專案的方式與經驗"),
|
| 93 |
gr.Textbox(label="判斷標準", lines=15, value=criteria_default)
|
| 94 |
],
|
| 95 |
outputs=[
|
| 96 |
gr.Textbox(label=f"第{i+1}次分析結果") for i in range(5)
|
| 97 |
],
|
| 98 |
title="ChatGPT 人格分析工具(五次獨立呼叫)",
|
| 99 |
+
description="此工具會使用 GPT-4o 根據輸入的三段內容與判斷標準執行五次獨立分析。三段內容將合併為一篇分析文章。"
|
| 100 |
)
|
| 101 |
|
| 102 |
# 執行主程式
|