Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 32a23d8

Browse files
committed
group diff lines
1 parent d092706 commit 32a23d8

File tree

1 file changed

+7
-22
lines changed

1 file changed

+7
-22
lines changed

docs/guides/python/ai-podcast-part-2.mdx

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -171,18 +171,17 @@ import tempfile
171171
main_api = api("main")
172172
# A job for generating our audio content
173173
gen_audio_job = job("audio")
174-
# !diff +
174+
# !diff(1:2) +
175175
# A job for generating our audio script
176-
# !diff +
177176
gen_podcast_job = job("podcast")
178177

179178
# A bucket for storing output audio clips
180179
clips_bucket = bucket("clips")
181180
# And another bucket for storing our models
182181
models_bucket = bucket("models")
183-
# !diff +
182+
183+
# !diff(1:2) +
184184
# A bucket for storing our scripts
185-
# !diff +
186185
scripts_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 +
306303
async 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

324313
Nitric.run()
@@ -396,25 +385,21 @@ services:
396385
batch-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

410396
runtimes:
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

420405
preview:

0 commit comments

Comments
 (0)