import torchfrom transformers import AutoModelForCausalLM, AutoTokenizer model_id = "nabin2004/AOS-qwen3-8b-narrated-merged" tokenizer = AutoTokenizer.from_pretrained(model_id, trust_remote_code=True)model = AutoModelForCausalLM.from_pretrained( model_id, torch_dtype=torch.bfloat16, device_map="auto", trust_remote_code=True,) prompt = "Create a narrated Manim animation explaining the Fourier Transform with voiceover bookmarks."messages = [ {{"role": "system", "content": "You are an expert mathematical animation assistant specializing in Manim Community Edition and voiceover narration with manim-voiceover. You write complete, self-contained, fully executable Python scripts inheriting from VoiceoverScene."}}, {{"role": "user", "content": prompt}}] text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)inputs = tokenizer([text], return_tensors="pt").to(model.device) outputs = model.generate( **inputs, max_new_tokens=2048, temperature=0.2, top_p=0.95, pad_token_id=tokenizer.eos_token_id,)print(tokenizer.decode(outputs[0][len(inputs.input_ids[0]):], skip_special_tokens=True))