Spaces:
Sleeping
Sleeping
Niki Zhang
commited on
Update app.py
Browse files
app.py
CHANGED
|
@@ -846,21 +846,21 @@ def upload_callback(image_input, state, visual_chatgpt=None, openai_api_key=None
|
|
| 846 |
|
| 847 |
|
| 848 |
if language=="English":
|
| 849 |
-
if narritive=="Third" :
|
| 850 |
state = [
|
| 851 |
(
|
| 852 |
None,
|
| 853 |
f"🤖 Hi, I am EyeSee. Let's explore this painting '{name}' together. You can click on the area you're interested in and choose from four types of information: Description, Analysis, Interpretation, and Judgment. Based on your selection, I will provide you with the relevant information."
|
| 854 |
)
|
| 855 |
]
|
| 856 |
-
elif narritive=="Artist":
|
| 857 |
state = [
|
| 858 |
(
|
| 859 |
None,
|
| 860 |
f"🧑🎨 Hello, I am the {artist}. Welcome to explore my painting, '{name}'. You can click on the area you're interested in and choose from four types of information: Description, Analysis, Interpretation, and Judgment. Based on your selection, I will provide you with the relevant insights and thoughts behind my creation."
|
| 861 |
)
|
| 862 |
]
|
| 863 |
-
elif narritive=="
|
| 864 |
state = [
|
| 865 |
(
|
| 866 |
None,
|
|
@@ -868,21 +868,21 @@ def upload_callback(image_input, state, visual_chatgpt=None, openai_api_key=None
|
|
| 868 |
)
|
| 869 |
]
|
| 870 |
elif language=="Chinese":
|
| 871 |
-
if narritive == "Third":
|
| 872 |
state = [
|
| 873 |
(
|
| 874 |
None,
|
| 875 |
f"🤖 你好,我是 EyeSee。让我们一起探索这幅画《{name}》。你可以点击你感兴趣的区域,并选择四种信息类型之一:描述、分析、解读和评判。根据你的选择,我会为你提供相关的信息。"
|
| 876 |
)
|
| 877 |
]
|
| 878 |
-
elif narritive == "Artist":
|
| 879 |
state = [
|
| 880 |
(
|
| 881 |
None,
|
| 882 |
f"🧑🎨 你好,我是{artist}。欢迎探索我的画作《{name}》。你可以点击你感兴趣的区域,并选择四种信息类型之一:描述、分析、解读和评判。根据你的选择,我会为你提供我的创作背后的相关见解和想法。"
|
| 883 |
)
|
| 884 |
]
|
| 885 |
-
elif narritive == "
|
| 886 |
state = [
|
| 887 |
(
|
| 888 |
None,
|
|
@@ -1064,7 +1064,7 @@ def generate_prompt(focus_type, paragraph,length, sentiment, factuality, languag
|
|
| 1064 |
'language': language
|
| 1065 |
}
|
| 1066 |
|
| 1067 |
-
naritive_mapping = {"Third": 0, "Artist": 1, "
|
| 1068 |
|
| 1069 |
naritive_value=naritive_mapping[naritive]
|
| 1070 |
|
|
@@ -1803,8 +1803,8 @@ def create_ui():
|
|
| 1803 |
# downvote_btn = gr.Button(value="👎 Downvote", interactive=True)
|
| 1804 |
with gr.Row():
|
| 1805 |
naritive = gr.Radio(
|
| 1806 |
-
choices=["Third-person", "Single-Persona: Artist
|
| 1807 |
-
value="Third",
|
| 1808 |
label="narritive",
|
| 1809 |
scale=5,
|
| 1810 |
interactive=True)
|
|
|
|
| 846 |
|
| 847 |
|
| 848 |
if language=="English":
|
| 849 |
+
if narritive=="Third-person" :
|
| 850 |
state = [
|
| 851 |
(
|
| 852 |
None,
|
| 853 |
f"🤖 Hi, I am EyeSee. Let's explore this painting '{name}' together. You can click on the area you're interested in and choose from four types of information: Description, Analysis, Interpretation, and Judgment. Based on your selection, I will provide you with the relevant information."
|
| 854 |
)
|
| 855 |
]
|
| 856 |
+
elif narritive=="Single-Persona: Artist":
|
| 857 |
state = [
|
| 858 |
(
|
| 859 |
None,
|
| 860 |
f"🧑🎨 Hello, I am the {artist}. Welcome to explore my painting, '{name}'. You can click on the area you're interested in and choose from four types of information: Description, Analysis, Interpretation, and Judgment. Based on your selection, I will provide you with the relevant insights and thoughts behind my creation."
|
| 861 |
)
|
| 862 |
]
|
| 863 |
+
elif narritive=="Multi-Persona: Objects":
|
| 864 |
state = [
|
| 865 |
(
|
| 866 |
None,
|
|
|
|
| 868 |
)
|
| 869 |
]
|
| 870 |
elif language=="Chinese":
|
| 871 |
+
if narritive == "Third-person":
|
| 872 |
state = [
|
| 873 |
(
|
| 874 |
None,
|
| 875 |
f"🤖 你好,我是 EyeSee。让我们一起探索这幅画《{name}》。你可以点击你感兴趣的区域,并选择四种信息类型之一:描述、分析、解读和评判。根据你的选择,我会为你提供相关的信息。"
|
| 876 |
)
|
| 877 |
]
|
| 878 |
+
elif narritive == "Single-Persona: Artist":
|
| 879 |
state = [
|
| 880 |
(
|
| 881 |
None,
|
| 882 |
f"🧑🎨 你好,我是{artist}。欢迎探索我的画作《{name}》。你可以点击你感兴趣的区域,并选择四种信息类型之一:描述、分析、解读和评判。根据你的选择,我会为你提供我的创作背后的相关见解和想法。"
|
| 883 |
)
|
| 884 |
]
|
| 885 |
+
elif narritive == "Multi-Persona: Objects":
|
| 886 |
state = [
|
| 887 |
(
|
| 888 |
None,
|
|
|
|
| 1064 |
'language': language
|
| 1065 |
}
|
| 1066 |
|
| 1067 |
+
naritive_mapping = {"Third-person": 0, "Single-Persona: Artist": 1, "Multi-Persona: Objects": 2}
|
| 1068 |
|
| 1069 |
naritive_value=naritive_mapping[naritive]
|
| 1070 |
|
|
|
|
| 1803 |
# downvote_btn = gr.Button(value="👎 Downvote", interactive=True)
|
| 1804 |
with gr.Row():
|
| 1805 |
naritive = gr.Radio(
|
| 1806 |
+
choices=["Third-person", "Single-Persona: Artist","Multi-Persona: Objects"],
|
| 1807 |
+
value="Third-person",
|
| 1808 |
label="narritive",
|
| 1809 |
scale=5,
|
| 1810 |
interactive=True)
|