Translating notebooks#
We can also use bia-bob
to translate existing Jupyter notebooks. The same strategy could also be used to add detailed documentation to an existing notebook.
For training purposes, we will use the LLM infrastructure of ScaDS.AI in the National Compute Center ZIH TU Dresden.
When using bia-bob to prompt LLMs, the prompts you enter including existing variable names etc. are sent to the LLM provider. Do not submit any sensitive, secret or private information. Also check bia-bob’s code recommendations before executing them. LLMs make mistakes.
First, we configure bia-bob:
# load secret API key. You must unpack the contents of api_key.zip
# into the same folder before going ahead.
from dotenv import load_dotenv
load_dotenv()
import os
from bia_bob import bob
bob.initialize(endpoint='https://llm.scads.ai/v1', model='openai/gpt-oss-120b', api_key=os.environ.get('SCADSAI_API_KEY'))
%bob translate blob_segmentation_and_average_area.ipynb to German
The modified notebook has been saved as blob_segmentation_and_average_area_1.ipynb.
Exercise#
Ask bob to add more explanations to the notebook, e.g. ask it to explain the workflow “like I’m 10 years old”.