24 NOV 2026
Shannon: <context> I am running this Jupyter Notebook in Visual Studio Code. The cell execution appears to be hing at the cell
import sys
from pathlib import Path
</context>
<inputs>
<input index="1">
C:\Users\safetystation\Documents\production-ai-agents-for-media-generation\01-consistent-media-generation-on-serverless-gpus\code\nb-first-generation-local.ipynb
</input>
<input index="2">
https://github.com/DataTalksClub/production-ai-agents-for-media-generation/blob/main/01-consistent-media-generation-on-serverless-gpus/02-first-generation.md
</input>
</inputs>
<query>
Please help me diagnose the issue with this notebook execution.
</query>
Claude:
The import sys cell isn't hanging. It's the first cell you ran, so it's waiting for a Jupyter kernel that never starts. Any cell would stop at the same spot.
Why the kernel can't start
| Check | What I found |
|---|---|
| Python on this machine | Only 3.14.4 |
| Python the repo supports | requires-python = ">=3.12,<3.14" in pyproject.toml, so 3.14 is outside it |
| ipykernel in that Python | Not installed (ModuleNotFoundError) |
| Project virtual env (.venv) | Doesn't exist. The repo uses uv (uv.lock), but uv isn't installed |
| Registered Jupyter kernels | None |
The notebook's kernel setting is just a generic "Python 3". VS Code points that at your system Python 3.14, which has no ipykernel, so the cell sits on its spinner. The output panel usually shows a kernel-start error or an "install ipykernel?" prompt that's easy to miss.
The saved outputs in the notebook came from the course author's Mac (paths like /Users/mnrozhkov/...). They don't show that it ever ran on your machine.
Fix, from the repo root (production-ai-agents-for-media-generation):
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
uv sync --extra notebooks
.venv\Scripts\python.exe from the repo.You don't need the gpu extra on your laptop. This notebook only calls the remote Endpoint.
One more thing: the next cell (setup_endpoint()) asks for the URL and token with an input box at the top of VS Code. If execution seems stuck there, look for that prompt.
Shall I install uv and set up the project's .venv kernel for you?
The cell isn't really hanging: the Jupyter kernel never starts. Your only Python is 3.14 with no ipykernel, there's no project .venv, and the repo needs Python 3.12–3.13. Nothing has been installed or changed yet.
Yes, set it up I'll do it myself
Shannon: I'll do it myself
Sounds good. Once you've done step 3, the kernel name at the top right of the notebook should show the .venv environment, not "Python 3.14". When you run the import sys cell, it should finish almost at once with an execution number like [1].
If it still spins, send me what the Output panel shows for Jupyter (choose it from the dropdown there) and I'll take a look.
<python> # reload(image) keeps share_card already imported by that module. importlib.reload(share_card_module) importlib.reload(image) from common import asset_record, metrics, output_dir, setup_endpoint, wait_ready, write_json from image import ImageGenerator, cached_image, image_comparison, share_cardBASE_URL, TOKEN = setup_endpoint() </python> <query> Is it waiting for input from me? </query>
Claude:
Yes, it's very likely waiting for you. There's no code/.env file yet, so setup_endpoint() will ask for two things, one after the other:
Endpoint HTTPS URL:: paste your Endpoint's URL from the Nebius console (starting https://) and press Enter.Endpoint token:: paste the token and press Enter. It uses getpass, so the token won't show as you paste. That's expected.In VS Code these prompts appear as an input box at the top of the window, in the command-palette area, not inside the notebook. It's easy to miss, and if it loses focus it can vanish while the cell keeps spinning. If you can't see it, click the notebook and look at the top of the screen. If it's gone, interrupt the kernel (the ■ button) and run the cell again.
Once you've entered both, they're saved to code/.env, so later runs won't ask again.
Shannon: The output for the previous cell now says "Endpoint configured (***kew2) ". However, when I run the next cell
models = wait_ready(BASE_URL, TOKEN, deadline_s=600)
print("Served models:", [m.get("id") for m in models["data"]])
it gives and HTTPError .
Claude: It's an HTTP 404, and it comes from Nebius's tunnel, not from the model server. I sent a request to your Endpoint URL without the token, and Nebius's proxy answered:
HTTP/1.1 404 Not Found
Proxy-Status: nebius-tunnel; error=proxy_internal_response; details="unknown_tunnel"
A made-up hostname on the same domain gets exactly the same reply. So Nebius doesn't currently know a tunnel at https://port8000-jxcws3qypmkk60a.tunnel.applications.eu-west2.nebius.cloud. The request never reaches your model, so the token isn't the issue yet.
wait_ready only retries 429/502/503/504, the "still starting up" errors. A 404 is raised straight away, which is why the cell stopped with HTTPError.
Likely causes, most likely first:
RUNNING. It may be stopped, preempted, still provisioning, or deleted. Check its status in the Nebius console.To fix it:
RUNNING, copy its HTTPS URL. If it matches the one above, just re-run the wait_ready cell.code/.env and delete the BASE_URL line. If it's a new Endpoint, delete the TOKEN line too. Then restart the kernel and run the cells again from the top. Step 1 will ask for the new values.After the URL is right, you may see 502 for a few minutes while the model loads. The cell waits through that by itself.
Shannon: The endpoint is restarting. In the mean time, a question: In the Nebius console endpoint details page, is it the string of characters beginning with "tenantuseraccount-" that appears underneath my name, that is the actual endpoint token?
Claude:
No. The tenantuseraccount-… string under your name is your Nebius user account ID. It identifies who you are in the console, and it isn't a secret.
The Endpoint token is the one you generated in the Endpoint form when you created it. The course guide says it's shown only once, before you click Create, and you have to copy it then.
That matters right now. I checked the token saved in code/.env, looking only at its first characters and printing nothing else. It does start with tenantuseraccount-, so the notebook has your account ID stored as the token. Once the URL problem is fixed, you'd get 401 or 403 errors next.
To fix it:
TOKEN= line from code/.env, restart the kernel and run the cells from the top. Paste the real token when it asks.BASE_URL= and TOKEN= lines from code/.env before re-running. Stop or delete the old Endpoint so it doesn't keep billing.Shannon: I have deleted the endpoint. What is the URL of the instructor repository document that describes exactly how to set up a Nebius endpoint?
Claude: The setup steps are in the lesson guide you linked at the start. Look for the section on creating the Endpoint, around line 48:
https://github.com/DataTalksClub/production-ai-agents-for-media-generation/blob/main/01-consistent-media-generation-on-serverless-gpus/02-first-generation.md
The same file is in your local clone at 01-consistent-media-generation-on-serverless-gpus\02-first-generation.md.
The guide links to two more pages for the setup:
This time, generate the token in the form and copy it before you click Create. Then delete the BASE_URL= and TOKEN= lines from code/.env, restart the kernel, and run the notebook from the top.
Shannon:
<context>
I created a new endpoint, then copied the endpoint and the token into the code\.env file. I restarted the kernal. Starting from the top, I re-ran all cells. This same cell ran for 24.5 seconds before yielding an HTTPError .
Generated in 1.2 s Generated in 1.2 s
Identical: False
Generated in 1.2 s Generated in 1.5 s
Generated in 1.3 s
Endpoint configured (***i4kg)
HTTPError Traceback (most recent call last) Cell In[5], line 1 ----> 1 models = wait_ready(BASE_URL, TOKEN, deadline_s=600) 2 print("Served models:", [m.get("id") for m in models["data"]])
File ~\Documents\production-ai-agents-for-media-generation\01-consistent-media-generation-on-serverless-gpus\code\common.py:122, in wait_ready(base, token, deadline_s) 117 raise TimeoutError( 118 f"Readiness deadline reached (last error: {last_error}); " 119 "inspect logs and stop the Endpoint" 120 ) 121 try: --> 122 data = request(base, token, "/v1/models", timeout=min(30, remaining)) 123 if isinstance(data, dict) and isinstance(data.get("data"), list) and data["data"]: 124 return data
File ~\Documents\production-ai-agents-for-media-generation\01-consistent-media-generation-on-serverless-gpus\code\common.py:103, in request(base, token, route, body, timeout) 97 headers["Content-Type"] = "application/json" 98 req = urllib.request.Request( 99 base.rstrip("/") + route, 100 headers=headers, 101 data=None if body is None else json.dumps(body).encode(), 102 ) --> 103 with urllib.request.urlopen(req, timeout=timeout) as response: 104 return json.load(response) ... File ~\AppData\Roaming\uv\python\cpython-3.13-windows-x86_64-none\Lib\urllib\request.py:613, in HTTPDefaultErrorHandler.http_error_default(self, req, fp, code, msg, hdrs) 612 def http_error_default(self, req, fp, code, msg, hdrs): --> 613 raise HTTPError(req.full_url, code, msg, hdrs, fp)
HTTPError: HTTP Error 404: Not Found Output is truncated. View as a scrollable element or open in a text editor. Adjust cell output settings...
<output> The new URL and token are saved correctly. The token is 16 characters and no longer your account ID. But the new Endpoint has the same problem as before. I tried its URL just now, without the token, and Nebius answered:404 "No tunnel has this address." reason: unknown_tunnel, scope: pod
The 24.5 seconds is a useful clue. wait_ready only keeps polling on "still starting" errors (502/503/504/429), and a 404 stops it at once. So for about 20 seconds the Endpoint was answering, most likely with 502 while the model loaded. Then the tunnel disappeared. That means the Endpoint's pod (its container) stopped running soon after it started.
Check in the Nebius console, on the new Endpoint's page:
RUNNING.
STOPPED with code Preempted: Nebius took the cheap preemptible GPU back. Start it again; it won't restart on its own. The URL stays the same, so code/.env is still fine.ERROR, or it keeps restarting: open the Endpoint's Logs and look at the last lines. A crash while loading the model (for example, running out of memory or disk) shows up there.NotEnoughResources: no free GPU right now. Try later or in another region.When the console shows RUNNING again, just re-run the wait_ready cell. There's no need to restart the kernel or re-enter anything.
The Generated in 1.2 s and /Users/mnrozhkov/... lines in your output aren't from your run. They're saved outputs from the course author's Mac, still in the notebook file, so you can ignore them.
If the status or logs show something other than the cases above, paste the last few lines of the log here.
Shannon: The status was ERROR. I have restarted it. While we wait, here are the logs
24 Nov 12:34:24.880 Provisioning resources for the workload 24 Nov 12:21:42.691 ERROR: Application startup failed. Exiting. 24 Nov 12:21:42.618 24 Nov 12:21:42.618 24 Nov 12:21:42.618 For more detailed error information, run with CUDA_LOG_FILE=stderr 24 Nov 12:21:42.618 Search for `cudaErrorNoKernelImageForDevice' in https://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART__TYPES.html for more information. 24 Nov 12:21:42.618 torch.AcceleratorError: CUDA error: no kernel image is available for execution on the device 24 Nov 12:21:42.618 ^^^^^ 24 Nov 12:21:42.618 return t.to( 24 Nov 12:21:42.618 File "/usr/local/lib/python3.12/dist-packages/torch/nn/modules/module.py", line 1369, in convert 24 Nov 12:21:42.618 ^^^^^^^^^ 24 Nov 12:21:42.618 param_applied = fn(param) 24 Nov 12:21:42.618 File "/usr/local/lib/python3.12/dist-packages/torch/nn/modules/module.py", line 964, in _apply 24 Nov 12:21:42.618 module._apply(fn) 24 Nov 12:21:42.618 File "/usr/local/lib/python3.12/dist-packages/torch/nn/modules/module.py", line 933, in _apply 24 Nov 12:21:42.618 ^^^^^^^^^^^^^^^^^^^^ 24 Nov 12:21:42.618 return self._apply(convert) 24 Nov 12:21:42.618 File "/usr/local/lib/python3.12/dist-packages/torch/nn/modules/module.py", line 1383, in to 24 Nov 12:21:42.618 ^^^^^^^^^^^^^^^^^^^^^^^^^^^ 24 Nov 12:21:42.618 return super().to(*args, **kwargs) 24 Nov 12:21:42.618 File "/usr/local/lib/python3.12/dist-packages/transformers/modeling_utils.py", line 3761, in to 24 Nov 12:21:42.618 pipe.text_encoder.to(torch.bfloat16) 24 Nov 12:21:42.618 File "/app/serve.py", line 66, in load_pipeline 24 Nov 12:21:42.618 ^^^^^^^^^^^^^^^ 24 Nov 12:21:42.618 _pipe = load_pipeline() 24 Nov 12:21:42.618 File "/app/serve.py", line 92, in lifespan 24 Nov 12:21:42.618 ^^^^^^^^^^^^^^^^^^^^^ 24 Nov 12:21:42.618 return await anext(self.gen) 24 Nov 12:21:42.618 File "/usr/lib/python3.12/contextlib.py", line 210, in aenter 24 Nov 12:21:42.618 async with self.lifespan_context(app) as maybe_state: 24 Nov 12:21:42.618 File "/usr/local/lib/python3.12/dist-packages/starlette/routing.py", line 638, in lifespan 24 Nov 12:21:42.618 ERROR: Traceback (most recent call last): 24 Nov 12:21:40.731 queued_call() 24 Nov 12:21:40.731 24 Nov 12:21:40.731 If you want to use the NVIDIA B300 SXM6 PC GPU with PyTorch, please check the instructions at https://pytorch.org/get-started/locally/ 24 Nov 12:21:40.731 The current PyTorch install supports CUDA capabilities sm_50 sm_60 sm_70 sm_75 sm_80 sm_86 sm_90. 24 Nov 12:21:40.731 NVIDIA B300 SXM6 PC with CUDA capability sm_103 is not compatible with the current PyTorch installation. 24 Nov 12:21:40.731 /usr/local/lib/python3.12/dist-packages/torch/cuda/init.py:540: UserWarning: 24 Nov 12:21:40.731 _warn_unsupported_code(d, device_cc, code_ccs) 24 Nov 12:21:40.731 For CUDA 13.2 use pip install torch==2.13.0 --index-url https://download.pytorch.org/whl/cu132 24 Nov 12:21:40.731 For CUDA 13.0 use pip install torch==2.13.0 --index-url https://download.pytorch.org/whl/cu130 24 Nov 12:21:40.731 For CUDA 12.9 use pip install torch==2.13.0 --index-url https://download.pytorch.org/whl/cu129 24 Nov 12:21:40.731 Your installed torch==2.13.0+cu126 does not include kernels for this GPU. Reinstall the same version against a CUDA build that does, e.g.: 24 Nov 12:21:40.731
Claude: That log shows the cause: the Endpoint is running on the wrong GPU for this container. Restarting it will fail the same way, so stop it now. A B300 is expensive and bills while it provisions.
What the log says:
Found GPU0 NVIDIA B300 SXM6 PC ... compute capability (CC) 10.3: the Endpoint got an NVIDIA B300, a newer Blackwell GPU.Your installed torch==2.13.0+cu126 does not include kernels for this GPU and supports ... sm_80 sm_86 sm_90: the PyTorch in the Sana container image goes up to sm_90 (Hopper: H100/H200). It has no code built for the B300's sm_103.pipe.text_encoder.to(torch.bfloat16) in serve.py), CUDA fails with no kernel image is available for execution on the device. The app exits, and the Endpoint goes to ERROR.That also explains your 24.5 seconds: about 20 seconds of 502s while the model loaded, then the crash, then the 404 once the pod was gone.
Fix: stop or delete this Endpoint and create a new one on a GPU the container supports. The course template uses an L40S, and the notebook has ENDPOINT_GPU = "L40S". Open the Sana template link again (https://console.nebius.com/serverless/endpoint/create?template=sana). Before clicking Create, check the GPU / platform field. If it shows B300 or B200, change it to L40S. H100 or H200 would also work but cost more. If your region doesn't offer an L40S, pick another region that does.
You can't change the GPU on this Endpoint by restarting it. As before, copy the new token before clicking Create. Then put the new BASE_URL and TOKEN in code/.env, restart the kernel, and run the notebook from the top.
Shannon: I have finished the assignment ``. Now I need to complete the homework. The homework entry form requires a submission URL. I will push this closed repo to a new repo on my own GitHub account. Please list the steps I will follow to create an appropriate fine grained personal access token, then the commands I will run in the terminal to push this modified repo to GitHub.
Claude:
Nothing secret will go up. code/.env (your token), .venv/, runs/ and __pycache__/ are all ignored by the repo's .gitignore. The only change Git sees is your edited nb-first-generation-local.ipynb. The notebook has no token in it. One cell's output prints your old Endpoint's URL (https://port8000-y15…eu-north1…); that's harmless once the Endpoint is deleted.
Because runs/ is ignored, your generated images won't be pushed, but they're embedded in the notebook outputs. Right now origin points to DataTalksClub/production-ai-agents-for-media-generation, which you can't push to, so we'll add your repo as a second remote.
production-ai-agents-for-media-generation.push-media-gen-homework. Expiration: 7 days is plenty..github/workflows/.Run these from the course repo folder. First, go there:
cd C:\Users\safetystation\Documents\production-ai-agents-for-media-generation
Stage and commit your completed notebook:
git add 01-consistent-media-generation-on-serverless-gpus/code/nb-first-generation-local.ipynb
git commit -m "Lesson 01 homework: first generation notebook with outputs"
Add your repo as a second remote. The original stays as origin, so you can still pull course updates:
git remote add mine https://github.com/spycebot/production-ai-agents-for-media-generation.git
Push main to your repo:
git push -u mine main
When Git asks you to sign in, Git Credential Manager may open a window. Choose Token (or "Personal access token") if offered and paste the PAT. If it asks for a username and password instead, use spycebot as the username and the PAT as the password.
After the push, use the link to the notebook itself:
https://github.com/spycebot/production-ai-agents-for-media-generation/blob/main/01-consistent-media-generation-on-serverless-gpus/code/nb-first-generation-local.ipynb
Open it in a private browser window first. That confirms it's public and that the outputs and images render.
A couple of side notes:
LF will be replaced by CRLF warning. It's harmless.git push -u mine main, a plain git pull will pull from your repo, not the course. To get course updates later, run git pull origin main.Shannon: PS C:\Users\safetystation\Documents\production-ai-agents-for-media-generation> git push -u mine main remote: Permission to spycebot/production-ai-agents-for-media-generation.git denied to spycebot. fatal: unable to access 'https://github.com/spycebot/production-ai-agents-for-media-generation.git/': The requested URL returned error: 403
I believe I need to run a login command
Claude: You don't need a separate login command. Git never asked you for anything: it reused a token it had already saved for github.com.
Your Git uses Git Credential Manager, and it already holds a saved login for https://github.com. That's probably the fine-grained token you use for the SNG repos, which only has access to those repos. Git sent that token as spycebot, and GitHub refused it for the new repo. That's the "Permission … denied to spycebot" 403. The new PAT was never used.
The simplest fix that doesn't break your SNG pushes: tell this repo only to look up credentials by the full repo URL. The saved github.com login then won't match, and Git will ask for one.
In the course repo folder:
git config credential.useHttpPath true
git push -u mine main
When it asks you to sign in, choose Token / Personal access token and paste the new PAT. If it asks for a username and password, use spycebot and the PAT. Git Credential Manager saves it for this repo's URL only, so your SNG repos keep using their existing token.
If it still returns 403 after you've pasted the new PAT, the token itself is the problem. On the token's page on GitHub, check two things:
You can edit an existing fine-grained token; you don't have to make a new one. Push again afterwards.
Shannon: PS C:\Users\safetystation\Documents\production-ai-agents-for-media-generation> git config credential.useHttpPath true PS C:\Users\safetystation\Documents\production-ai-agents-for-media-generation> git push -u mine main remote: Permission to spycebot/production-ai-agents-for-media-generation.git denied to spycebot. fatal: unable to access 'https://github.com/spycebot/production-ai-agents-for-media-generation.git/': The requested URL returned error: 403
It does not ask for the new PAT
Claude:
The cause is a GitHub CLI setting, not a stored password. Your global ~/.gitconfig has this line, which gh auth setup-git added at some point:
credential.https://github.com.helper = !gh.exe auth git-credential
So for every github.com URL, Git asks the gh CLI for a token, and gh always hands over the token it's logged in with: your SNG-scoped github_pat_…. I confirmed that Git returns that token for the new repo's URL. That's why useHttpPath changed nothing and you never got a prompt.
Fix for this repo only (your SNG repos keep using gh as they do now). Run these in the course repo folder. The --% matters: PowerShell 5.1 otherwise drops the empty "", which is what clears the inherited helpers.
git config --% credential.https://github.com.helper ""
git config --add credential.https://github.com.helper manager
git push -u mine main
This time Git Credential Manager should pop up a sign-in. Choose Token, paste the new PAT, and it's saved for this repo's URL only.
Avoid running gh auth login with the new PAT. That swaps the token gh uses everywhere, so your SNG repos would start failing.
Shannon: https://github.com/spycebot/production-ai-agents-for-media-generation/blob/main/01-consistent-media-generation-on-serverless-gpus/code/nb-first-generation-local.ipynb It is interesting to use a cloud GPU to generate media assets. However, in the Practice** section, I am unhappy with the depiction of the girl, because her eyes do not align (we would say that she is cross-eyed (eyes pointing in) or wall-eyed (eyes pointing out)). If it were my job to produce these images, how would I correct this issue with the eyes so that the images were more appealing?
Claude: Congratulations on getting the homework submitted. I looked at your Practice cells, and a few things in the setup make wandering eyes likely. Here's how I'd fix them, cheapest first.
Why it happens here
512x512 and a full figure: girl, dress, hat, cake, plus snow, a laptop or decorations. The face may only be about 50 pixels across, so each eye is a handful of pixels. Diffusion models handle small details badly, and eyes are where people notice it most. The model you're using, Sana_1600M_1024px, was also trained for 1024×1024, so 512 is below its native size.Fixes at generation time (all available in generate_image / ImageGenerator)
size="1024x1024"). This is the biggest single improvement for faces.ImageGenerator.generate_image accepts negative_prompt= (it's "" by default in models.py). Try "cross-eyed, misaligned eyes, asymmetrical eyes, deformed face". It helps, but it won't guarantee a fix.num_inference_steps=20; 28–30 often sharpens fine detail. You can leave guidance_scale at 4.5.Fixing an image you otherwise like (the professional route)
For your birthday-card images, I'd try 1024×1024, waist-up framing, "simple round dot eyes looking at the viewer" in the prompt, and a handful of seeds. That will probably fix it without any editing step.
Shannon: https://courses.datatalks.club/production-ai-agents-generative-media/homework/module1 Question 7 in he homework asks "What is your projected cost per asset at N = 1000, in USD?" How do I determine this. Was this something I should have read from the Nebius cloud endpoint before I deleted it?
Claude: You don't need anything more from the deleted Endpoint. At N = 1000, the times you could only have read there (startup and model load) change the answer by about a tenth of a cent per thousand assets.
How the course computes it (lesson 05 and the homework instructions):
Cost per asset = F / N + c
- F (fixed, paid once per run) = (startup + model load seconds) × price per second
- c (paid per asset) = median generation seconds × price per second
Your numbers
Generated in … s lines from your saved notebook. They range from 1.7 to 2.0 s, and the median is 1.9. These times are measured from your laptop, so they include network time and slightly overstate GPU time. The homework says any honest answer counts, so that's fine.startup_s: null in your metrics.json). Your earlier B300 Endpoint's logs show about 4–4.5 minutes from "Provisioning" to the model loaded, so use about 260 s as an estimate.Q7 at N = 1000, preemptible ($0.65/h = $0.000181/s):
If your Endpoint was not preemptible ($1.35/h), it's about $0.0008.
Your fixed cost could be off by a minute either way and the answer would still round to $0.0004. That's the lesson's point: with large batches, cost per asset is almost entirely generation time × price.
If you want to confirm which rate you actually paid, Billing → Usage in the Nebius console still shows the deleted Endpoint's charges. The line item should say whether it was billed as preemptible.
Shannon: For the previous two courses, I did not make any FAQ contribution along with the homework. I would like to begin doing so now. How do I go about this? Do I make a modification to the repo?
Claude: No, you don't change the course repo. DataTalksClub keeps all its course FAQs in a separate repo, DataTalksClub/faq, and new entries are proposed through a GitHub issue form, not a pull request.
How to contribute (from that repo's CONTRIBUTING.md):
Pull requests are only for fixing an existing entry.
Their writing tips, in short:
What to put in the homework form: neither the FAQ page nor the contribution guide says. The link to your proposal issue (https://github.com/DataTalksClub/faq/issues/…) is the natural thing to submit. If the form asks for something else, the course Slack channel #course-ai-mediagen can confirm.
You already have good material from today, each a real problem another student could hit:
wait_ready fail with HTTPError 404?" unknown_tunnel means the Endpoint isn't running (stopped, crashed or deleted), or the URL is out of date. Check its status and logs in the console.tenantuseraccount-… string in the console my Endpoint token?" No, it's your account ID. The token is shown once in the create form.uv sync --extra notebooks and select .venv.hall I draft a FAQ entry from one of today's problems for you to paste in?
New FAQ entries for DataTalksClub courses go through a GitHub issue form on the DataTalksClub/faq repo. You don't change the course repo or open a pull request. Nothing has been drafted or submitted yet.
Shannon: Yes, draft one
Claude: Here's a draft for the B300 problem, the one most likely to help other students. Check the course FAQ first in case someone has already posted it. Copy the two fields into the form, and pick Production AI Agents for Generative Media as the course.
Question
Why does my Sana Endpoint go to ERROR with "CUDA error: no kernel image is available for execution on the device"?
Answer
The Endpoint is running on a GPU that the container's PyTorch build doesn't support. Recreate it on an L40S (or H100/H200).
In the Endpoint's **Logs** you'll see the model download and load, then a crash when the weights are moved to the GPU:
```
Found GPU0 NVIDIA B300 SXM6 PC which is of compute capability (CC) 10.3.
Your installed torch==2.13.0+cu126 does not include kernels for this GPU.
...
torch.AcceleratorError: CUDA error: no kernel image is available for execution on the device
ERROR: Application startup failed. Exiting.
```
The Sana container's PyTorch is built for CUDA 12.6, which supports GPUs up to compute capability 9.0 (`sm_90`: Hopper, e.g. H100/H200). Blackwell GPUs such as the B200 and B300 (`sm_100`/`sm_103`) need a newer CUDA build, so the server exits and the Endpoint goes to `ERROR`.
Restarting won't help, because it starts on the same GPU. To fix it:
1. Stop or delete the failed Endpoint. A B300 is expensive and bills while it provisions.
2. Create a new Endpoint from the [Sana template](https://console.nebius.com/serverless/endpoint/create?template=sana) and, before clicking **Create**, check the GPU/platform field is **L40S**, the GPU the lesson uses. H100 or H200 also work but cost more.
3. Copy the new token before clicking **Create**, then delete `BASE_URL` and `TOKEN` from `code/.env`, restart the kernel, and run the notebook from the top.
In the notebook, `wait_ready` shows this as about 20 seconds of waiting followed by `HTTPError: HTTP Error 404: Not Found`. The 404 is because the crashed Endpoint's tunnel no longer exists.
A couple of things to check before you submit:
I can draft any of the other three the same way.
Shannon: Please draft an answer to "Why does the first notebook cell hang in VS Code on Windows?" based on the details in this session that we had today.
Claude: Here's the draft. Pick Production AI Agents for Generative Media as the course and paste the two fields in.
Question
Why does the first cell of the lesson notebook hang in VS Code on Windows?
Answer
The cell isn't hanging. VS Code is waiting for a Jupyter kernel that can't start. Create the course's own environment with `uv` and select it as the kernel.
Even a cell as simple as this one keeps spinning and never gets an execution number:
```python
import sys
from pathlib import Path
```
Usually the notebook has picked a plain "Python 3" kernel, which VS Code points at your system Python. If that Python has no `ipykernel` installed, the kernel never starts. The course repository also needs **Python 3.12 or 3.13** (`requires-python = ">=3.12,<3.14"` in `pyproject.toml`). So if your only Python is 3.14, installing `ipykernel` into it isn't the fix either.
To fix it:
1. Install [uv](https://docs.astral.sh/uv/getting-started/installation/) (PowerShell):
```powershell
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
```
2. Open a new terminal in the repository root and create the environment. uv downloads a compatible Python by itself, and the `notebooks` extra includes `ipykernel`:
```powershell
uv sync --extra notebooks
```
You don't need the `gpu` extra on your laptop. The local notebook only calls the remote Endpoint.
3. In VS Code, click the kernel picker (top right of the notebook) → **Select Another Kernel** → **Python Environments**, and choose `.venv\Scripts\python.exe` in the repository.
4. Restart the kernel and run the notebook from the top. The first cell should finish almost at once.
If it still spins, open **View → Output** and choose **Jupyter** in the dropdown to see why the kernel failed to start.
The cell that calls `setup_endpoint()` can also look stuck. On the first run it asks for the Endpoint URL and token in an input box at the **top of the VS Code window**, not in the notebook. If the box loses focus it can disappear: interrupt the kernel and run the cell again.
A few notes:
AppData\Local\Python\pythoncore-3.14-64. The answer only mentions 3.14 as the version that doesn't work.