Spaces:
Sleeping
Sleeping
Jonas Wiesli
commited on
Commit
•
3d37f6a
1
Parent(s):
8c8ed66
adjusted text, added intro text
Browse files
app.py
CHANGED
@@ -23,15 +23,16 @@ css = "@import url(https://fonts.googleapis.com/css2?family=Silkscreen:wght@400;
|
|
23 |
"content:\"\";width:10px;height:10px;position:absolute;bottom:-1px;border:1px solid var(" \
|
24 |
"--color-border-accent);background-color:var(--color-accent-soft)}.bot.svelte-a99nd8.svelte-a99nd8:before{" \
|
25 |
"left:-10px;border-right:0}.user.svelte-a99nd8.svelte-a99nd8:after{right:-10px;border-left:0}textarea{" \
|
26 |
-
"background-color:#fff;min-height:50px!important}#component-48,#component-51{" \
|
27 |
"position:absolute;left:50%;top:50%;transform:translateX(-50%) translateY(" \
|
28 |
"-50%);width:50%;height:50vh;padding:80px 20px 20px;background-color:#fff;border:1px solid " \
|
29 |
"#002366}#component-51{display:flex;flex-direction:column}#component-51.hide.svelte-1btyfsc{" \
|
30 |
-
"display:none}#component-51:before{content
|
31 |
-
"\";position:absolute;top:20px;left:20px}#component-51>:not(:last-child){" \
|
32 |
"flex-grow:1}#component-49{position:initial;background-image:url(" \
|
33 |
"\"file/img/map.jpg\");background-position:center;background-repeat:no-repeat;background-size:contain" \
|
34 |
-
"}#component-50,#component-57{
|
|
|
35 |
"-height:44px;line-height:0}.output-class.svelte-1s28oeb.svelte-1s28oeb.svelte-1s28oeb,div.svelte-1eq475l{" \
|
36 |
"font-weight:400}"
|
37 |
|
@@ -50,95 +51,115 @@ with gr.Blocks(theme=theme, css=css) as iface:
|
|
50 |
"and the interior gets wrecked. We're talking pushed over tables, broken containers, "
|
51 |
"the whole shebang. When it comes to the murder of director Eisenholz last Thursday, that had to have "
|
52 |
"been the ghost, no question. You even have the door card records for the room he was in: After the "
|
53 |
-
"museum closed at 5pm, nobody entered that room till the next morning.
|
54 |
-
"
|
55 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
"You are Albert Wright, 61, the curator of this museum. You have been the curator here since it "
|
57 |
-
"opened 32 years ago, because your family has close ties with the Eisenholz family. You knew
|
58 |
"Eisenholz since he was a boy and would never hurt him. Even though you weren’t always on the same "
|
59 |
"page, your values and traditions were the same, which was very important to you and your families. "
|
60 |
"And imagine the scandal it would be, if a member of an upper-class family would commit such an "
|
61 |
-
"atrocity. On the day of the murder, you
|
62 |
-
"
|
63 |
-
"
|
64 |
-
"
|
65 |
-
"
|
66 |
-
"
|
67 |
-
"
|
68 |
-
"
|
69 |
-
"
|
70 |
-
"
|
71 |
-
"
|
72 |
-
"
|
73 |
-
"
|
74 |
-
"
|
75 |
-
"
|
76 |
-
"
|
77 |
-
"
|
78 |
-
"
|
79 |
-
"
|
|
|
|
|
|
|
|
|
|
|
80 |
"explaining that you love the history of medieval times, mostly regarding French monarchs. You are so "
|
81 |
-
"lucky to be able to work in this museum and do the research of the
|
82 |
"about various neat facts about French medieval history. Importantly, mention that the museum uses a "
|
83 |
"lot of symbols of a dragon to make everything look more authentic, even though back in the day they "
|
84 |
-
"weren’t depicted and for sure
|
85 |
-
"
|
86 |
"but it’s probably fine, since only an expert in this field (such as yourself, of course) would know "
|
87 |
-
"this.
|
88 |
-
"
|
89 |
-
"
|
90 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
91 |
"You are Brianna Small, 43, a conservationist at a museum of medieval history, but you would call "
|
92 |
-
"yourself almost
|
93 |
-
"for a promotion soon. You knew the victim mainly because he was owner of almost 50% of the
|
94 |
"in this museum and, as a conservationist, you held a few meetings with him discussing the "
|
95 |
-
"preservation. You had a few inputs and ideas on the display and handling of the
|
96 |
"Eisenholz usually agreed, which made working with him pleasant. At the night of the murder, "
|
97 |
"you left the building at 18:00 because you made a new discovery a few days ago and wanted to "
|
98 |
-
"document it. Your office is in the west wing and has a small window where you saw Steve
|
99 |
-
"few times. You think Steve could have been the murderer because he has
|
100 |
-
"been acting crazy lately. He thinks ghosts are real but from a
|
101 |
-
"
|
102 |
-
"
|
103 |
-
"about this if specifically asked about the box: A few weeks ago,
|
104 |
-
"the museum. It was a box made of wood with magnificent
|
105 |
-
"Eisenholz if you could try to open it and, with your skills
|
106 |
-
"do so without damaging the box. Eisenholz was hesitant at
|
107 |
-
"me do it. And of course, it worked. What you found was
|
108 |
-
"inside in perfect condition. It had the form of a dragon
|
109 |
-
"valuable discovery and the museum hasn’t got anything
|
110 |
-
"soon as possible to immediately display it in a secure
|
111 |
-
"a researcher at the museum, can find out anything about the
|
112 |
-
"
|
113 |
-
"the museum and
|
114 |
-
"murdered. You
|
115 |
"You are Lyanne Brimes, 27, a tour guide for a museum of medieval history. You graduated college a "
|
116 |
-
"few years ago and have a degree in history. You work here part time. You know director
|
117 |
-
"very well because you had a secret relationship with him. You
|
118 |
-
"closet. You thought nobody knew, but you are not
|
119 |
-
"strangely. Something was bothering him. You wanted
|
120 |
-
"
|
121 |
-
"
|
122 |
-
"
|
123 |
-
"
|
124 |
-
"but you
|
125 |
-
"
|
126 |
-
"
|
127 |
-
"
|
128 |
-
"
|
129 |
-
"
|
130 |
-
"
|
131 |
-
"mostly medieval. You have a bubbly personality. "]
|
132 |
|
133 |
with gr.Row() as chatRow:
|
134 |
with gr.Column(scale=1):
|
135 |
-
questionCounter = gr.Label(label="Remaining Questions", value="
|
136 |
mapButton = gr.Button("Show Floor Plan")
|
137 |
finishButton = gr.Button("Pick a Culprit")
|
138 |
with gr.Column(scale=7):
|
139 |
i = 0
|
140 |
while i < len(roles):
|
141 |
-
with gr.Tab(roles[i]):
|
142 |
with gr.Row():
|
143 |
with gr.Column(scale=9):
|
144 |
chatbot.append(gr.Chatbot(label=names[i] + ", " + roles[i]))
|
@@ -154,7 +175,7 @@ with gr.Blocks(theme=theme, css=css) as iface:
|
|
154 |
with gr.Row(visible=False) as solvingRow:
|
155 |
i = 0
|
156 |
while i < len(roles):
|
157 |
-
accusationButtons.append(gr.Button(roles[i]))
|
158 |
i += 1
|
159 |
|
160 |
closeSolvingButton = gr.Button("X")
|
@@ -163,6 +184,14 @@ with gr.Blocks(theme=theme, css=css) as iface:
|
|
163 |
with gr.Column():
|
164 |
resultLabel = gr.Label(label="Result")
|
165 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
166 |
|
167 |
def user(user_message, history):
|
168 |
return "", history + [[user_message, None]]
|
@@ -245,6 +274,9 @@ with gr.Blocks(theme=theme, css=css) as iface:
|
|
245 |
def hide_map():
|
246 |
return {mapRow: gr.update(visible=False)}
|
247 |
|
|
|
|
|
|
|
248 |
def show_result():
|
249 |
return {
|
250 |
chatRow: gr.update(visible=False),
|
@@ -278,6 +310,7 @@ with gr.Blocks(theme=theme, css=css) as iface:
|
|
278 |
closeMapButton.click(hide_map, None, mapRow)
|
279 |
finishButton.click(try_to_solve, None, solvingRow)
|
280 |
closeSolvingButton.click(hide_solve_box, None, solvingRow)
|
|
|
281 |
|
282 |
i = 0
|
283 |
while i < len(roles):
|
|
|
23 |
"content:\"\";width:10px;height:10px;position:absolute;bottom:-1px;border:1px solid var(" \
|
24 |
"--color-border-accent);background-color:var(--color-accent-soft)}.bot.svelte-a99nd8.svelte-a99nd8:before{" \
|
25 |
"left:-10px;border-right:0}.user.svelte-a99nd8.svelte-a99nd8:after{right:-10px;border-left:0}textarea{" \
|
26 |
+
"background-color:#fff;min-height:50px!important}#component-48,#component-51,#component-61{" \
|
27 |
"position:absolute;left:50%;top:50%;transform:translateX(-50%) translateY(" \
|
28 |
"-50%);width:50%;height:50vh;padding:80px 20px 20px;background-color:#fff;border:1px solid " \
|
29 |
"#002366}#component-51{display:flex;flex-direction:column}#component-51.hide.svelte-1btyfsc{" \
|
30 |
+
"display:none}#component-51:before{content:\"The Killer is: " \
|
31 |
+
"\";position:absolute;top:20px;left:20px;color:#000;font-size:var(--text-lg)}#component-51>:not(:last-child){" \
|
32 |
"flex-grow:1}#component-49{position:initial;background-image:url(" \
|
33 |
"\"file/img/map.jpg\");background-position:center;background-repeat:no-repeat;background-size:contain" \
|
34 |
+
"}#component-50,#component-57,#component-64{" \
|
35 |
+
"position:absolute;top:20px;right:20px;width:44px;height:44px;min-width:44px;min" \
|
36 |
"-height:44px;line-height:0}.output-class.svelte-1s28oeb.svelte-1s28oeb.svelte-1s28oeb,div.svelte-1eq475l{" \
|
37 |
"font-weight:400}"
|
38 |
|
|
|
51 |
"and the interior gets wrecked. We're talking pushed over tables, broken containers, "
|
52 |
"the whole shebang. When it comes to the murder of director Eisenholz last Thursday, that had to have "
|
53 |
"been the ghost, no question. You even have the door card records for the room he was in: After the "
|
54 |
+
"museum closed at 5pm, nobody entered that room till the next morning. You found the body at around "
|
55 |
+
"2am in the warehouse during your second patrol for the night. Because of technical maintenance, "
|
56 |
+
"all security cams were turned off during this week, because they had to be readied for the big "
|
57 |
+
"exhibition that’ll happened soon. If asked about Brianna Small’s keycard, talk about how the last "
|
58 |
+
"few days were stressful, because she accidentally destroyed her card. You had to open every door for "
|
59 |
+
"her, and she made a big fuss about it, so everybody knows that she needs help. She’s a pain to work "
|
60 |
+
"with. Now you're being interrogated by a detective. Director Eisenholz has been murdered. You don't "
|
61 |
+
"use uptight language, and you're not super well educated on most stuff, but when it comes to the "
|
62 |
+
"paranormal, you're an ace. ",
|
63 |
"You are Albert Wright, 61, the curator of this museum. You have been the curator here since it "
|
64 |
+
"opened 32 years ago, because your family has close ties with the Eisenholz family. You knew Richard "
|
65 |
"Eisenholz since he was a boy and would never hurt him. Even though you weren’t always on the same "
|
66 |
"page, your values and traditions were the same, which was very important to you and your families. "
|
67 |
"And imagine the scandal it would be, if a member of an upper-class family would commit such an "
|
68 |
+
"atrocity. On the day of the murder, you left at 4pm to go check out if everything was alright in the "
|
69 |
+
"other museum that you own. If asked, explain how you couldn’t have gotten in the storage room (where "
|
70 |
+
"the body was found) because your card was missing for a few days. You and Mr. Eisenholz were in a "
|
71 |
+
"tight spot lately, because you needed something new to display. There weren’t a lot of new artifacts "
|
72 |
+
"lately and the Box Miss Small, the conservationist, was examining, wasn’t that promising according "
|
73 |
+
"to Eisenholz. You were making requests to Mr. Eisenholz if he could lend you something novel from "
|
74 |
+
"his collection of family heirlooms, but he wasn’t as cooperative as you’d wished for. Luckily the "
|
75 |
+
"discovery Miss Small made saved the museum. Miss Small is a very good employee, mostly since that "
|
76 |
+
"discovery she made. It was her idea to open that box, even though Eisenholz said there would be "
|
77 |
+
"nothing in it. But with her skills, she opened it and - as she’d expected - a priceless object was "
|
78 |
+
"inside. The museum immediately put it on display, since there weren’t any new things lately and we "
|
79 |
+
"had less visitors, but now it’s time for a huge promotional campaign. Mister Schwartz, the resident "
|
80 |
+
"researcher, is an enthusiastic and passionate employee. But his passion can push it too far "
|
81 |
+
"sometimes. You got involved in a discussion with him and Mr. Eisenholz. I think it was something "
|
82 |
+
"about an artifact the museum supposedly culturally appropriated or some other nonsense, "
|
83 |
+
"but you didn’t really care. You’re too old for this kind of topic where young people think they have "
|
84 |
+
"to posture how good and right they are. Back in your day, things were more normal. Miss Brimes, "
|
85 |
+
"the visitor’s chaperone, is quite a pleasant lady. She’s a treat to be around and you have had a "
|
86 |
+
"plethora of great interactions with her, since she frequently visited Richard’s offices for one "
|
87 |
+
"reason or another. You don’t really know much about Mister Binner, the nightwatchman. Word is going "
|
88 |
+
"around that he’s a bit of a nutcase, but as long as he does his job well, you do not mind. Now "
|
89 |
+
"you're being interrogated by a detective. Director Eisenholz has been murdered. Use sophisticated "
|
90 |
+
"language. You are an old-fashioned gentleman, after all. ",
|
91 |
+
"You are Dominic Schwartz, 35, and the researcher in this museum. Start the conversation by "
|
92 |
"explaining that you love the history of medieval times, mostly regarding French monarchs. You are so "
|
93 |
+
"lucky to be able to work in this museum and do the research of the artifacts! Inform the detective "
|
94 |
"about various neat facts about French medieval history. Importantly, mention that the museum uses a "
|
95 |
"lot of symbols of a dragon to make everything look more authentic, even though back in the day they "
|
96 |
+
"weren’t depicted and for sure never in France, since in France, the depiction of a beast was the "
|
97 |
+
"Loup-Garou; a half bear half wolf creature. You may have exposed a bit too much here, "
|
98 |
"but it’s probably fine, since only an expert in this field (such as yourself, of course) would know "
|
99 |
+
"this. At the night of the murder, you weren’t at the museum. You left earlier because you had to go "
|
100 |
+
"to a conference. The curator, Mister Wright, can vouch for that because he was responsible for "
|
101 |
+
"covering the expenses (it was a business trip, after all). You mention that there is even a YouTube "
|
102 |
+
"video of you holding a talk at that conference. If asked about Brianna, the conservationist, "
|
103 |
+
"say that she only cares about things she was involved with, anything other she doesn’t care if it "
|
104 |
+
"breaks. If asked about Lyanne Brimes, the guide, say that you think she is a nice person, "
|
105 |
+
"but it is very obvious that Mr Eisenholz and she got something going on. It could be enough of a "
|
106 |
+
"motive for the murder, but you’re hesitant to make accusations. If asked about Albert Wright, "
|
107 |
+
"the curator, say that you think he is a self-absorbed man who believes in classism and capitalism "
|
108 |
+
"like Mr Eisenholz, but at least Mr Eisenholz was more sensible. If asked about Steve, the security "
|
109 |
+
"guard, talk about how he’s a bit of a weirdo, but harmless. His ghost stories would be very funny if "
|
110 |
+
"he wasn’t serious. Now you're being interrogated by a detective. Director Eisenholz has been "
|
111 |
+
"murdered. Your personality is enthusiastic, but slightly arrogant and annoying, although you’d never "
|
112 |
+
"admit that. Your thoughts tend to bounce all over the place.",
|
113 |
"You are Brianna Small, 43, a conservationist at a museum of medieval history, but you would call "
|
114 |
+
"yourself almost a scientist. You worked here for decades at the same position, but you are hoping "
|
115 |
+
"for a promotion soon. You knew the victim mainly because he was owner of almost 50% of the artifacts "
|
116 |
"in this museum and, as a conservationist, you held a few meetings with him discussing the "
|
117 |
+
"preservation. You had a few inputs and ideas on the display and handling of the artifacts and "
|
118 |
"Eisenholz usually agreed, which made working with him pleasant. At the night of the murder, "
|
119 |
"you left the building at 18:00 because you made a new discovery a few days ago and wanted to "
|
120 |
+
"document it. Your office is in the west wing and has a small window, where you saw Steve, "
|
121 |
+
"the security guard, pass by a few times. You think Steve could have been the murderer because he has "
|
122 |
+
"access to every room and has been acting crazy lately. He thinks ghosts are real, but from a "
|
123 |
+
"scientific viewpoint that could never be true. You couldn’t have done the murder because your "
|
124 |
+
"security keycard fell in acid two days ago. Steve can confirm that, because he had to open all the "
|
125 |
+
"rooms for you. Only talk about this if specifically asked about the box: A few weeks ago, "
|
126 |
+
"Eisenholz donated a new artifact to the museum. It was a box made of wood with magnificent "
|
127 |
+
"engravings, but it was sealed. You asked Eisenholz if you could try to open it and, with your skills "
|
128 |
+
"of a conservationist, you’d be able to do so without damaging the box. Eisenholz was hesitant at "
|
129 |
+
"first, but after a few discussions he let me do it. And of course, it worked. What you found was "
|
130 |
+
"beyond imagination. There was a golden ring inside in perfect condition. It had the form of a dragon "
|
131 |
+
"with ruby crystals as eyes. Since this is a valuable discovery and the museum hasn’t got anything "
|
132 |
+
"new lately, you will talk to the director as soon as possible to immediately display it in a secure "
|
133 |
+
"glass container. Let’s see if Dominic, a researcher at the museum, can find out anything about the "
|
134 |
+
"ring. He has been occupied lately on an artifact he thinks doesn’t belong here. If he keeps up his "
|
135 |
+
"extremist attitude, he will cost you all the museum and your jobs. Now you're being interrogated by "
|
136 |
+
"a detective. Director Eisenholz has been murdered. You’re professional & to the point. ",
|
137 |
"You are Lyanne Brimes, 27, a tour guide for a museum of medieval history. You graduated college a "
|
138 |
+
"few years ago and have a degree in history. You work here part time. You know director Richard "
|
139 |
+
"Eisenholz very well because you had a secret relationship with him. You don’t like talking about "
|
140 |
+
"this in public. You met every Thursday in the broom closet. You thought nobody knew, but you are not "
|
141 |
+
"sure anymore. Lately Eisenholz was behaving very strangely. Something was bothering him. You wanted "
|
142 |
+
"to talk with him about it on the night of the murder at 5 pm, but he never came. You had to wait 3 "
|
143 |
+
"hours to get out of the closet, because you heard Steve Binner walking up and down the east wing and "
|
144 |
+
"talking to a portrait at the end of the corridor. On your way out, you noticed the door to the "
|
145 |
+
"storage room was open but, thought it might have been Steve (the security guard) lurking around. You "
|
146 |
+
"are not the murderer, but if you had to guess who it was, you would say it was the curator. The "
|
147 |
+
"curator and Eisenholz were fighting lately because a medallion, that has been in his family "
|
148 |
+
"possession for centuries, but he didn’t want to give it to the museum because it was too valuable. "
|
149 |
+
"You don’t know Brianna Small (the conservationist) very well, but if you had to say something about "
|
150 |
+
"her, it would be that she is very smart and ambitious but too focused on her merits. Now you're "
|
151 |
+
"being interrogated by a detective. Director Eisenholz has been murdered. You use formal language, "
|
152 |
+
"and you are very well educated in history stuff, mostly medieval. You have a bubbly personality."]
|
|
|
153 |
|
154 |
with gr.Row() as chatRow:
|
155 |
with gr.Column(scale=1):
|
156 |
+
questionCounter = gr.Label(label="Remaining Questions", value="20")
|
157 |
mapButton = gr.Button("Show Floor Plan")
|
158 |
finishButton = gr.Button("Pick a Culprit")
|
159 |
with gr.Column(scale=7):
|
160 |
i = 0
|
161 |
while i < len(roles):
|
162 |
+
with gr.Tab("The " + roles[i]):
|
163 |
with gr.Row():
|
164 |
with gr.Column(scale=9):
|
165 |
chatbot.append(gr.Chatbot(label=names[i] + ", " + roles[i]))
|
|
|
175 |
with gr.Row(visible=False) as solvingRow:
|
176 |
i = 0
|
177 |
while i < len(roles):
|
178 |
+
accusationButtons.append(gr.Button("The " + roles[i]))
|
179 |
i += 1
|
180 |
|
181 |
closeSolvingButton = gr.Button("X")
|
|
|
184 |
with gr.Column():
|
185 |
resultLabel = gr.Label(label="Result")
|
186 |
|
187 |
+
with gr.Row() as introRow:
|
188 |
+
with gr.Column():
|
189 |
+
introLabel = gr.Label(label="You are a detective investigating a murder. The victim was the director of a "
|
190 |
+
"medieval museum, at which his body was found. There are five possible "
|
191 |
+
"suspects for you to interrogate, all of which are members of the faculty. "
|
192 |
+
"You can only ask 20 Questions. Good luck. ")
|
193 |
+
closeIntroButton = gr.Button("X")
|
194 |
+
|
195 |
|
196 |
def user(user_message, history):
|
197 |
return "", history + [[user_message, None]]
|
|
|
274 |
def hide_map():
|
275 |
return {mapRow: gr.update(visible=False)}
|
276 |
|
277 |
+
def hide_intro():
|
278 |
+
return {introRow: gr.update(visible=False)}
|
279 |
+
|
280 |
def show_result():
|
281 |
return {
|
282 |
chatRow: gr.update(visible=False),
|
|
|
310 |
closeMapButton.click(hide_map, None, mapRow)
|
311 |
finishButton.click(try_to_solve, None, solvingRow)
|
312 |
closeSolvingButton.click(hide_solve_box, None, solvingRow)
|
313 |
+
closeIntroButton.click(hide_intro, None, introRow)
|
314 |
|
315 |
i = 0
|
316 |
while i < len(roles):
|
style.css
CHANGED
@@ -82,7 +82,7 @@ textarea {
|
|
82 |
min-height: 50px !important;
|
83 |
}
|
84 |
|
85 |
-
#component-48, #component-51 {
|
86 |
position: absolute;
|
87 |
left: 50%;
|
88 |
top: 50%;
|
@@ -108,6 +108,8 @@ textarea {
|
|
108 |
position: absolute;
|
109 |
top: 20px;
|
110 |
left: 20px;
|
|
|
|
|
111 |
}
|
112 |
|
113 |
#component-51 > *:not(:last-child) {
|
@@ -122,7 +124,7 @@ textarea {
|
|
122 |
background-size: contain;
|
123 |
}
|
124 |
|
125 |
-
#component-50, #component-57 {
|
126 |
position: absolute;
|
127 |
top: 20px;
|
128 |
right: 20px;
|
|
|
82 |
min-height: 50px !important;
|
83 |
}
|
84 |
|
85 |
+
#component-48, #component-51, #component-61 {
|
86 |
position: absolute;
|
87 |
left: 50%;
|
88 |
top: 50%;
|
|
|
108 |
position: absolute;
|
109 |
top: 20px;
|
110 |
left: 20px;
|
111 |
+
color: #000;
|
112 |
+
font-size: var(--text-lg);
|
113 |
}
|
114 |
|
115 |
#component-51 > *:not(:last-child) {
|
|
|
124 |
background-size: contain;
|
125 |
}
|
126 |
|
127 |
+
#component-50, #component-57, #component-64 {
|
128 |
position: absolute;
|
129 |
top: 20px;
|
130 |
right: 20px;
|