@@ -171,18 +171,17 @@ import tempfile
171171main_api = api(" main" )
172172# A job for generating our audio content
173173gen_audio_job = job(" audio" )
174- # !diff +
174+ # !diff(1:2) +
175175# A job for generating our audio script
176- # !diff +
177176gen_podcast_job = job(" podcast" )
178177
179178# A bucket for storing output audio clips
180179clips_bucket = bucket(" clips" )
181180# And another bucket for storing our models
182181models_bucket = bucket(" models" )
183- # !diff +
182+
183+ # !diff(1:2) +
184184# A bucket for storing our scripts
185- # !diff +
186185scripts_bucket = bucket(" scripts" )
187186
188187# Many cloud API Gateways impose hard response time limits on synchronous requests.
@@ -298,27 +297,17 @@ async def submit_audio(ctx: HttpContext):
298297
299298 await generate_audio.submit({" file" : name, " model_id" : model_id, " text" : body.decode(' utf-8' ), " preset" : preset})
300299
301- # !diff +
300+ # !diff(1:12) +
302301# Generate a full podcast from script to audio
303- # !diff +
304302@main_api.post (" /podcast/:title" )
305- # !diff +
306303async def submit_script (ctx : HttpContext):
307- # !diff +
308304 title = ctx.req.params[" title" ]
309- # !diff +
310-
311- # !diff +
312305 body = ctx.req.data
313- # !diff +
306+
314307 if body is None :
315- # !diff +
316308 ctx.res.status = 400
317- # !diff +
318309 return
319- # !diff +
320310
321- # !diff +
322311 await generate_podcast.submit({" title" : title, " prompt" : body.decode(' utf-8' )})
323312
324313Nitric.run()
@@ -396,25 +385,21 @@ services:
396385batch-services :
397386 # !diff -
398387 - match : batches/*.py
399- # !diff +
388+ # !diff(1:6) +
400389 - match : batches/podcast.py
401390 start : uv run watchmedo auto-restart -p *.py --no-restart-on-command-exit -R python -- -u $SERVICE_PATH
402391 runtime : torch
403- # !diff +
404392 - match : batches/script.py
405- # !diff +
406393 start : uv run watchmedo auto-restart -p *.py --no-restart-on-command-exit -R python -- -u $SERVICE_PATH
407- # !diff +
408394 runtime : llama
409395
410396runtimes :
411397 python :
412398 dockerfile : ' ./python.dockerfile'
413399 torch :
414400 dockerfile : ' ./torch.dockerfile'
415- # !diff +
401+ # !diff(1:2) +
416402 llama :
417- # !diff +
418403 dockerfile : ' ./llama.dockerfile'
419404
420405preview :
0 commit comments