adelevett commited on
Commit
facf571
·
1 Parent(s): fe59d31

Add Carl Sagan Demon-Haunted World simulation to choices list and include demo_chat_2.json

Browse files
Files changed (2) hide show
  1. app.py +13 -2
  2. sample/demo_chat_2.json +349 -0
app.py CHANGED
@@ -33,6 +33,15 @@ def get_demo_html() -> str:
33
  chat_data = []
34
  return load_template_with_data("xLljoibgUvk", chat_data)
35
 
 
 
 
 
 
 
 
 
 
36
  # Global store for custom simulations
37
  custom_simulation_store = {
38
  "video_id": "",
@@ -42,6 +51,8 @@ custom_simulation_store = {
42
  def play_simulation_selection(selection: str) -> str:
43
  if selection == "Steve Jobs 1983 Speech (Demo)":
44
  return get_demo_html()
 
 
45
  elif selection == "My Custom Simulation":
46
  if custom_simulation_store["video_id"] and custom_simulation_store["chat_data"]:
47
  return load_template_with_data(custom_simulation_store["video_id"], custom_simulation_store["chat_data"])
@@ -115,7 +126,7 @@ def handle_generation(yt_url: str, pdf_file, doc_text: str, srt_text: str, hf_to
115
  return (
116
  new_html,
117
  success_msg,
118
- gr.update(choices=["Steve Jobs 1983 Speech (Demo)", "My Custom Simulation"], value="My Custom Simulation")
119
  )
120
  except Exception as e:
121
  error_msg = f"### ❌ Error running pipeline\n{e}"
@@ -243,7 +254,7 @@ with gr.Blocks(title="ReLiveStream - Interactive Replay", theme=custom_theme, cs
243
  with gr.TabItem("🎭 Theater Mode"):
244
  with gr.Row():
245
  sim_selector = gr.Radio(
246
- choices=["Steve Jobs 1983 Speech (Demo)", "My Custom Simulation"],
247
  value="Steve Jobs 1983 Speech (Demo)",
248
  label="Choose Simulation to Play",
249
  interactive=True
 
33
  chat_data = []
34
  return load_template_with_data("xLljoibgUvk", chat_data)
35
 
36
+ def get_demo_2_html() -> str:
37
+ demo_json_path = os.path.join(os.path.dirname(__file__), "sample", "demo_chat_2.json")
38
+ if os.path.exists(demo_json_path):
39
+ with open(demo_json_path, "r", encoding="utf-8") as f:
40
+ chat_data = json.load(f)
41
+ else:
42
+ chat_data = []
43
+ return load_template_with_data("NtRf4icqE7o", chat_data)
44
+
45
  # Global store for custom simulations
46
  custom_simulation_store = {
47
  "video_id": "",
 
51
  def play_simulation_selection(selection: str) -> str:
52
  if selection == "Steve Jobs 1983 Speech (Demo)":
53
  return get_demo_html()
54
+ elif selection == "Carl Sagan Demon-Haunted World (Demo)":
55
+ return get_demo_2_html()
56
  elif selection == "My Custom Simulation":
57
  if custom_simulation_store["video_id"] and custom_simulation_store["chat_data"]:
58
  return load_template_with_data(custom_simulation_store["video_id"], custom_simulation_store["chat_data"])
 
126
  return (
127
  new_html,
128
  success_msg,
129
+ gr.update(choices=["Steve Jobs 1983 Speech (Demo)", "Carl Sagan Demon-Haunted World (Demo)", "My Custom Simulation"], value="My Custom Simulation")
130
  )
131
  except Exception as e:
132
  error_msg = f"### ❌ Error running pipeline\n{e}"
 
254
  with gr.TabItem("🎭 Theater Mode"):
255
  with gr.Row():
256
  sim_selector = gr.Radio(
257
+ choices=["Steve Jobs 1983 Speech (Demo)", "Carl Sagan Demon-Haunted World (Demo)", "My Custom Simulation"],
258
  value="Steve Jobs 1983 Speech (Demo)",
259
  label="Choose Simulation to Play",
260
  interactive=True
sample/demo_chat_2.json ADDED
@@ -0,0 +1,349 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [
2
+ {
3
+ "id": "m0_6",
4
+ "username": "JustHereForMemes",
5
+ "text": "my feeling charlie: need more coffee ASAP ☕ LUL",
6
+ "anchor_id": "anc_0",
7
+ "displayTime": 2.7639715690567956
8
+ },
9
+ {
10
+ "id": "m0_1",
11
+ "username": "CharlieFan99",
12
+ "text": "my feeling charlie… classic Sagan opening lol",
13
+ "anchor_id": "anc_0",
14
+ "displayTime": 6.266350277903765
15
+ },
16
+ {
17
+ "id": "m0_3",
18
+ "username": "LazyViewer",
19
+ "text": "wait, is that Carl Sagan? Kappa",
20
+ "anchor_id": "anc_0",
21
+ "reply_to": "m0_1",
22
+ "displayTime": 10.690437747078494
23
+ },
24
+ {
25
+ "id": "m0_2",
26
+ "username": "SkepticalSam",
27
+ "text": "pseudoscience and superstition have always been with us, no doubt. no cap",
28
+ "anchor_id": "anc_1",
29
+ "displayTime": 10.98554448846597
30
+ },
31
+ {
32
+ "id": "m0_7",
33
+ "username": "ScienceLover42",
34
+ "text": "science propels us forward, but folks still cling to ancient myths. Pog",
35
+ "anchor_id": "anc_1",
36
+ "displayTime": 15.28792088175009
37
+ },
38
+ {
39
+ "id": "m0_4",
40
+ "username": "NewAgeBuster",
41
+ "text": "calling out new‑age fluff, love it 😎",
42
+ "anchor_id": "anc_2",
43
+ "displayTime": 20.169765747824364
44
+ },
45
+ {
46
+ "id": "m0_8",
47
+ "username": "EduCritic",
48
+ "text": "reminds me of anti‑intellectualism getting institutionalized in schools now. wtf",
49
+ "anchor_id": "anc_3",
50
+ "displayTime": 23.442045871960232
51
+ },
52
+ {
53
+ "id": "m0_5",
54
+ "username": "FundieWatcher",
55
+ "text": "fundamentalist zealotry isn’t new, but it’s way more dangerous now. ngl",
56
+ "anchor_id": "anc_3",
57
+ "displayTime": 27.255195118396834
58
+ },
59
+ {
60
+ "id": "m1_1",
61
+ "username": "PolicyWonk",
62
+ "text": "If the public can't get science, who the heck decides? 😳",
63
+ "anchor_id": "anc_4",
64
+ "displayTime": 34.05638024442969
65
+ },
66
+ {
67
+ "id": "m1_2",
68
+ "username": "CongressCritic",
69
+ "text": "Only a few Congress folks have a science background… then they axed their own advisory office. LUL",
70
+ "anchor_id": "anc_5",
71
+ "displayTime": 42.244682453403044
72
+ },
73
+ {
74
+ "id": "m1_6",
75
+ "username": "LazyViewer",
76
+ "text": "From the ’90s? Still hits. No cap",
77
+ "anchor_id": "anc_5",
78
+ "displayTime": 44.78480203367105
79
+ },
80
+ {
81
+ "id": "m1_5",
82
+ "username": "SkepticalSam",
83
+ "text": "Rep‑controlled Congress axed O.T.A., basically saying 'don't tell us'. Kappa",
84
+ "anchor_id": "anc_6",
85
+ "displayTime": 52.93196254332071
86
+ },
87
+ {
88
+ "id": "m1_7",
89
+ "username": "JustHereForMemes",
90
+ "text": "Don't tell us, we wanna stay clueless. LMAO",
91
+ "anchor_id": "anc_6",
92
+ "displayTime": 53.17431614607161
93
+ },
94
+ {
95
+ "id": "m1_3",
96
+ "username": "DemocracyDefender",
97
+ "text": "Exactly the ignorance neolibs exploit to tear down public edu. 🤦‍♂️",
98
+ "anchor_id": "anc_7",
99
+ "displayTime": 58.17785046271192
100
+ },
101
+ {
102
+ "id": "m1_8",
103
+ "username": "ScienceLover42",
104
+ "text": "More science literacy early on, that's why public edu matters. 👍",
105
+ "anchor_id": "anc_7",
106
+ "displayTime": 61.84178521186802
107
+ },
108
+ {
109
+ "id": "m1_4",
110
+ "username": "TechFuture",
111
+ "text": "Who's really calling the shots on tech? Probably lobbyists. Pog",
112
+ "anchor_id": "anc_7",
113
+ "displayTime": 62.125917635090076
114
+ },
115
+ {
116
+ "id": "m1_9",
117
+ "username": "EduCritic",
118
+ "text": "Defund edu = citizens who can't even ask questions. Giroux called it. 🤔",
119
+ "anchor_id": "anc_7",
120
+ "reply_to": "m1_3",
121
+ "displayTime": 64.61322243676221
122
+ },
123
+ {
124
+ "id": "m2_6",
125
+ "username": "LazyViewer",
126
+ "text": "Who’s the science maven? 🤔",
127
+ "anchor_id": "anc_9",
128
+ "displayTime": 79.58983361630987
129
+ },
130
+ {
131
+ "id": "m2_8",
132
+ "username": "FundieWatcher",
133
+ "text": "VP signing something 'new literary scientifically'? What even is that, lol",
134
+ "anchor_id": "anc_9",
135
+ "displayTime": 79.72764398332113
136
+ },
137
+ {
138
+ "id": "m2_3",
139
+ "username": "HistoryBuff",
140
+ "text": "President's science advisor still a thing? Glad it survived, fr",
141
+ "anchor_id": "anc_9",
142
+ "displayTime": 79.99952844064123
143
+ },
144
+ {
145
+ "id": "m2_5",
146
+ "username": "SkepticalSam",
147
+ "text": "Letting kids suffer instead of insulin = child abuse, plain and simple. No cap",
148
+ "anchor_id": "anc_10",
149
+ "displayTime": 81.19764074867888
150
+ },
151
+ {
152
+ "id": "m2_2",
153
+ "username": "ScienceFan42",
154
+ "text": "Creationists and Christian Scientists, the usual suspects 🤦‍♂️",
155
+ "anchor_id": "anc_10",
156
+ "displayTime": 84.82636353536519
157
+ },
158
+ {
159
+ "id": "m2_7",
160
+ "username": "NewAgeBuster",
161
+ "text": "Astrology = cold reading with star signs, ngl",
162
+ "anchor_id": "anc_11",
163
+ "displayTime": 95.51454633864626
164
+ },
165
+ {
166
+ "id": "m2_1",
167
+ "username": "AstrologyRoaster",
168
+ "text": "Astrologers get the scorn they deserve, lol",
169
+ "anchor_id": "anc_11",
170
+ "displayTime": 97.3224308960711
171
+ },
172
+ {
173
+ "id": "m2_4",
174
+ "username": "JustHereForMemes",
175
+ "text": "Scorn = pure derision, lol Kappa",
176
+ "anchor_id": "anc_11",
177
+ "displayTime": 97.36159228818954
178
+ },
179
+ {
180
+ "id": "m3_4",
181
+ "username": "SkepticalSam",
182
+ "text": "The danger is real—society built on science/tech that nobody gets. Pog",
183
+ "anchor_id": "anc_13",
184
+ "displayTime": 110.34742082149546
185
+ },
186
+ {
187
+ "id": "m3_8",
188
+ "username": "CongressCritic",
189
+ "text": "They axed the office that gave competent advice… self‑inflicted ignorance. Kappa",
190
+ "anchor_id": "anc_13",
191
+ "displayTime": 112.66457013767017
192
+ },
193
+ {
194
+ "id": "m3_5",
195
+ "username": "LazyViewer",
196
+ "text": "It's gonna blow up in our faces… like climate denial. 🤦‍♂️",
197
+ "anchor_id": "anc_14",
198
+ "displayTime": 120.27908655078053
199
+ },
200
+ {
201
+ "id": "m3_1",
202
+ "username": "DemocracyDefender",
203
+ "text": "Combustible mix of ignorance + power—classic neoliberal playbook: keep folks clueless to control ’em. LUL",
204
+ "anchor_id": "anc_14",
205
+ "displayTime": 122.23231951977698
206
+ },
207
+ {
208
+ "id": "m3_6",
209
+ "username": "JustHereForMemes",
210
+ "text": "Ignorance + power, name a more iconic duo. LMAO",
211
+ "anchor_id": "anc_14",
212
+ "displayTime": 125.07109639846813
213
+ },
214
+ {
215
+ "id": "m3_3",
216
+ "username": "PolicyWonk",
217
+ "text": "We need public edu that teaches critical thinking, not just job skills. No cap",
218
+ "anchor_id": "anc_14",
219
+ "displayTime": 125.51921472539341
220
+ },
221
+ {
222
+ "id": "m3_7",
223
+ "username": "EduCritic",
224
+ "text": "Giroux: neoliberalism turns edu into a corporate service station, cranking out compliant workers, not critical citizens. 🤔",
225
+ "anchor_id": "anc_14",
226
+ "reply_to": "m3_1",
227
+ "displayTime": 126.14852575373257
228
+ },
229
+ {
230
+ "id": "m3_2",
231
+ "username": "ScienceFan42",
232
+ "text": "Who runs science in a democracy when nobody knows anything? Exactly! 😂",
233
+ "anchor_id": "anc_15",
234
+ "displayTime": 127.71402964438211
235
+ },
236
+ {
237
+ "id": "m3_9",
238
+ "username": "TechFuture",
239
+ "text": "We need more scientists in politics, not just lawyers. PogChamp",
240
+ "anchor_id": "anc_15",
241
+ "displayTime": 130.6169353550217
242
+ },
243
+ {
244
+ "id": "m4_1",
245
+ "username": "SkepticalSam",
246
+ "text": "Science isn’t just facts, it’s a mindset. fr",
247
+ "anchor_id": "anc_16",
248
+ "displayTime": 139.33001293105406
249
+ },
250
+ {
251
+ "id": "m4_11",
252
+ "username": "HistoryBuff",
253
+ "text": "Straight out of Sagan’s ‘Demon‑Haunted World’—timeless. LUL",
254
+ "anchor_id": "anc_16",
255
+ "displayTime": 142.35409230511064
256
+ },
257
+ {
258
+ "id": "m4_12",
259
+ "username": "TechFuture",
260
+ "text": "Teach this mindset from elementary, not just college. no cap",
261
+ "anchor_id": "anc_17",
262
+ "displayTime": 145.35312728003862
263
+ },
264
+ {
265
+ "id": "m4_2",
266
+ "username": "ScienceLover42",
267
+ "text": "Questioning the universe while knowing we’re fallible—that’s science. LUL",
268
+ "anchor_id": "anc_17",
269
+ "displayTime": 148.31831854283953
270
+ },
271
+ {
272
+ "id": "m4_10",
273
+ "username": "ScienceFan42",
274
+ "text": "Human fallibility = key; science self‑corrects because we can be wrong. 5Head",
275
+ "anchor_id": "anc_18",
276
+ "displayTime": 152.6826821789717
277
+ },
278
+ {
279
+ "id": "m4_3",
280
+ "username": "DemocracyDefender",
281
+ "text": "Public ed should teach asking skeptical Qs, not just memorizing facts. no cap",
282
+ "anchor_id": "anc_19",
283
+ "displayTime": 156.49715989184045
284
+ },
285
+ {
286
+ "id": "m4_7",
287
+ "username": "PolicyWonk",
288
+ "text": "If we can’t question truth‑tellers, we’re vulnerable. Propaganda danger. MonkaS",
289
+ "anchor_id": "anc_19",
290
+ "displayTime": 158.08060289563664
291
+ },
292
+ {
293
+ "id": "m4_14",
294
+ "username": "SkepticalSam",
295
+ "text": "Ignorance + power = combustible mix—again, a recurring theme. MonkaS",
296
+ "anchor_id": "anc_19",
297
+ "displayTime": 159.59705866472734
298
+ },
299
+ {
300
+ "id": "m4_4",
301
+ "username": "EduCritic",
302
+ "text": "Giroux: this is core critical pedagogy—question authority, link knowledge to power. PogChamp",
303
+ "anchor_id": "anc_20",
304
+ "displayTime": 162.23404950770077
305
+ },
306
+ {
307
+ "id": "m4_9",
308
+ "username": "NewAgeBuster",
309
+ "text": "Skeptical of authority—includes gurus & wellness influencers. Pepega",
310
+ "anchor_id": "anc_20",
311
+ "displayTime": 164.45888409216764
312
+ },
313
+ {
314
+ "id": "m4_15",
315
+ "username": "LazyViewer",
316
+ "text": "Just here for the ambling charlatans. 😂",
317
+ "anchor_id": "anc_21",
318
+ "displayTime": 167.74770712862096
319
+ },
320
+ {
321
+ "id": "m4_8",
322
+ "username": "FundieWatcher",
323
+ "text": "Many religious leaders fit that charlatan label perfectly. Kappa",
324
+ "anchor_id": "anc_21",
325
+ "displayTime": 169.16676466008403
326
+ },
327
+ {
328
+ "id": "m4_5",
329
+ "username": "LazyViewer",
330
+ "text": "Next charlatan—political or religious—ambling in... foreshadowing much? LUL",
331
+ "anchor_id": "anc_21",
332
+ "displayTime": 171.33937865629773
333
+ },
334
+ {
335
+ "id": "m4_6",
336
+ "username": "JustHereForMemes",
337
+ "text": "Charlatan political or religious—basically every election cycle. 😂",
338
+ "anchor_id": "anc_21",
339
+ "displayTime": 171.84021047180602
340
+ },
341
+ {
342
+ "id": "m4_13",
343
+ "username": "CongressCritic",
344
+ "text": "R‑GOP Congress says ‘don’t tell us’—they hate skeptical interrogation. BibleThump",
345
+ "anchor_id": "anc_20",
346
+ "reply_to": "m4_4",
347
+ "displayTime": 173.03786633611978
348
+ }
349
+ ]