GauravGosain commited on
Commit
65f842e
·
verified ·
1 Parent(s): 29995c0

Deploy Small Talk: Reachy Mini AI podcast (gradio.Server + three.js + LiveKit)

Browse files
backend/__pycache__/server.cpython-313.pyc CHANGED
Binary files a/backend/__pycache__/server.cpython-313.pyc and b/backend/__pycache__/server.cpython-313.pyc differ
 
backend/server.py CHANGED
@@ -237,15 +237,17 @@ async def remove_reachy(room_id: str, req: IdentityRequest):
237
  # curated prop set the frontend bundles) to match a character description.
238
  LLM_SPACE = "build-small-hackathon/small-talk-llm"
239
  CURATED_PROPS = {
240
- "hats": ["wizard", "cowboy", "tophat", "crown", "party", "pirate",
241
- "viking", "propeller", "beanie", "santa", "halo"],
242
- "glasses": ["sunglasses", "monocle"],
 
243
  }
244
  STYLE_SYS = (
245
  "You are a wardrobe stylist for a Reachy Mini robot. Given a character, pick "
246
- "accessories ONLY from the allowed lists. Reply with ONLY a compact JSON "
247
- 'object: {"hat": <slug or null>, "glasses": <slug or null>, '
248
- '"color": "#rrggbb", "reason": "<=10 words"}. No prose, no markdown.'
 
249
  )
250
 
251
  _llm_client = None
@@ -270,13 +272,14 @@ async def style_reachy(req: StyleRequest):
270
  desc = (req.description or "").strip()[:600]
271
  if not desc:
272
  raise HTTPException(400, "describe your Reachy first")
273
- msg = (f"Allowed hats: {CURATED_PROPS['hats']}. "
274
- f"Allowed glasses: {CURATED_PROPS['glasses']}.\n\n"
275
- f"Character: {desc}\n\nPick the single most fitting hat (or null), "
276
- f"glasses (or null), and an accent colour hex.")
 
277
 
278
  def _call():
279
- return _get_llm().predict(msg, STYLE_SYS, 0.6, 110, api_name="/chat")
280
 
281
  try:
282
  raw = await asyncio.to_thread(_call)
@@ -291,12 +294,14 @@ async def style_reachy(req: StyleRequest):
291
  data = json.loads(m.group(0))
292
  except Exception:
293
  data = {}
294
- hat = data.get("hat") if data.get("hat") in CURATED_PROPS["hats"] else None
295
- glasses = data.get("glasses") if data.get("glasses") in CURATED_PROPS["glasses"] else None
296
  color = data.get("color")
297
  if not (isinstance(color, str) and re.fullmatch(r"#[0-9a-fA-F]{6}", color or "")):
298
  color = None
299
- return {"hat": hat, "glasses": glasses, "color": color, "reason": str(data.get("reason", ""))[:80]}
 
 
300
 
301
 
302
  def attach(app) -> None:
 
237
  # curated prop set the frontend bundles) to match a character description.
238
  LLM_SPACE = "build-small-hackathon/small-talk-llm"
239
  CURATED_PROPS = {
240
+ "hat": ["wizard", "cowboy", "tophat", "crown", "party", "pirate", "viking",
241
+ "propeller", "santa", "halo", "fedora", "graduation", "baseball"],
242
+ "face": ["sunglasses", "monocle", "3dglasses", "skigoggles", "mustache"],
243
+ "neck": ["bowtie", "necktie"],
244
  }
245
  STYLE_SYS = (
246
  "You are a wardrobe stylist for a Reachy Mini robot. Given a character, pick "
247
+ "accessories ONLY from the allowed lists (or null for a slot). Reply with "
248
+ 'ONLY a compact JSON object: {"hat": <slug|null>, "face": <slug|null>, '
249
+ '"neck": <slug|null>, "color": "#rrggbb", "reason": "<=10 words"}. '
250
+ "No prose, no markdown."
251
  )
252
 
253
  _llm_client = None
 
272
  desc = (req.description or "").strip()[:600]
273
  if not desc:
274
  raise HTTPException(400, "describe your Reachy first")
275
+ msg = (f"Allowed hat: {CURATED_PROPS['hat']}. "
276
+ f"Allowed face: {CURATED_PROPS['face']}. "
277
+ f"Allowed neck: {CURATED_PROPS['neck']}.\n\n"
278
+ f"Character: {desc}\n\nPick the single most fitting item per slot "
279
+ f"(or null for a slot) and an accent colour hex.")
280
 
281
  def _call():
282
+ return _get_llm().predict(msg, STYLE_SYS, 0.6, 120, api_name="/chat")
283
 
284
  try:
285
  raw = await asyncio.to_thread(_call)
 
294
  data = json.loads(m.group(0))
295
  except Exception:
296
  data = {}
297
+ out = {slot: (data.get(slot) if data.get(slot) in opts else None)
298
+ for slot, opts in CURATED_PROPS.items()}
299
  color = data.get("color")
300
  if not (isinstance(color, str) and re.fullmatch(r"#[0-9a-fA-F]{6}", color or "")):
301
  color = None
302
+ out["color"] = color
303
+ out["reason"] = str(data.get("reason", ""))[:80]
304
+ return out
305
 
306
 
307
  def attach(app) -> None:
frontend/dist/assets/index-CxiFZSul.js ADDED
The diff for this file is too large to render. See raw diff
 
frontend/dist/index.html CHANGED
@@ -11,7 +11,7 @@
11
  href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,300;12..96,400;12..96,500;12..96,600;12..96,700;12..96,800&family=Instrument+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600&family=JetBrains+Mono:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700&family=Orbitron:wght@500;700;900&family=Share+Tech+Mono&family=VT323&family=Noto+Sans+JP:wght@300;500&display=swap"
12
  rel="stylesheet"
13
  />
14
- <script type="module" crossorigin src="/assets/index-Dub7chTM.js"></script>
15
  <link rel="stylesheet" crossorigin href="/assets/index-DfiJtV1d.css">
16
  </head>
17
  <body>
 
11
  href="https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,300;12..96,400;12..96,500;12..96,600;12..96,700;12..96,800&family=Instrument+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600&family=JetBrains+Mono:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700&family=Orbitron:wght@500;700;900&family=Share+Tech+Mono&family=VT323&family=Noto+Sans+JP:wght@300;500&display=swap"
12
  rel="stylesheet"
13
  />
14
+ <script type="module" crossorigin src="/assets/index-CxiFZSul.js"></script>
15
  <link rel="stylesheet" crossorigin href="/assets/index-DfiJtV1d.css">
16
  </head>
17
  <body>
frontend/dist/props/3dglasses.glb ADDED
Binary file (21 kB). View file
 
frontend/dist/props/baseball.glb ADDED
Binary file (39.2 kB). View file
 
frontend/dist/props/bowtie.glb ADDED
Binary file (14.7 kB). View file
 
frontend/dist/props/curated.json CHANGED
@@ -55,13 +55,6 @@
55
  "credit": "Google",
56
  "license": "CREATIVE_COMMONS_BY"
57
  },
58
- "beanie": {
59
- "file": "beanie.glb",
60
- "slot": "hat",
61
- "name": "Beanie",
62
- "credit": "Google",
63
- "license": "CREATIVE_COMMONS_BY"
64
- },
65
  "santa": {
66
  "file": "santa.glb",
67
  "slot": "hat",
@@ -89,5 +82,61 @@
89
  "name": "Monocle",
90
  "credit": "Google",
91
  "license": "CREATIVE_COMMONS_BY"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
  }
93
  }
 
55
  "credit": "Google",
56
  "license": "CREATIVE_COMMONS_BY"
57
  },
 
 
 
 
 
 
 
58
  "santa": {
59
  "file": "santa.glb",
60
  "slot": "hat",
 
82
  "name": "Monocle",
83
  "credit": "Google",
84
  "license": "CREATIVE_COMMONS_BY"
85
+ },
86
+ "fedora": {
87
+ "file": "fedora.glb",
88
+ "slot": "hat",
89
+ "name": "Fedora",
90
+ "credit": "Google",
91
+ "license": "CREATIVE_COMMONS_BY"
92
+ },
93
+ "graduation": {
94
+ "file": "graduation.glb",
95
+ "slot": "hat",
96
+ "name": "Graduation cap",
97
+ "credit": "Eswar Anand",
98
+ "license": "CREATIVE_COMMONS_BY"
99
+ },
100
+ "baseball": {
101
+ "file": "baseball.glb",
102
+ "slot": "hat",
103
+ "name": "Baseball cap",
104
+ "credit": "Jarlan Perez",
105
+ "license": "CREATIVE_COMMONS_BY"
106
+ },
107
+ "3dglasses": {
108
+ "file": "3dglasses.glb",
109
+ "slot": "face",
110
+ "name": "3D glasses",
111
+ "credit": "Andy Moore",
112
+ "license": "CREATIVE_COMMONS_BY"
113
+ },
114
+ "skigoggles": {
115
+ "file": "skigoggles.glb",
116
+ "slot": "face",
117
+ "name": "Ski goggles",
118
+ "credit": "Jared Justus",
119
+ "license": "CREATIVE_COMMONS_BY"
120
+ },
121
+ "mustache": {
122
+ "file": "mustache.glb",
123
+ "slot": "face",
124
+ "name": "Mustache",
125
+ "credit": "Google",
126
+ "license": "CREATIVE_COMMONS_BY"
127
+ },
128
+ "bowtie": {
129
+ "file": "bowtie.glb",
130
+ "slot": "neck",
131
+ "name": "Bowtie",
132
+ "credit": "Google",
133
+ "license": "CREATIVE_COMMONS_BY"
134
+ },
135
+ "necktie": {
136
+ "file": "necktie.glb",
137
+ "slot": "neck",
138
+ "name": "Necktie",
139
+ "credit": "Google",
140
+ "license": "CREATIVE_COMMONS_BY"
141
  }
142
  }
frontend/dist/props/fedora.glb ADDED
Binary file (47.6 kB). View file
 
frontend/dist/props/graduation.glb ADDED
Binary file (20.3 kB). View file
 
frontend/dist/props/mustache.glb ADDED
Binary file (15 kB). View file
 
frontend/dist/props/necktie.glb ADDED
Binary file (28.5 kB). View file
 
frontend/dist/props/skigoggles.glb ADDED
Binary file (33.2 kB). View file