• Skip to primary navigation
  • Skip to content
  • Skip to footer
Saptarshi Datta Saptarshi Datta
  • About
  • Portfolio
    Saptarshi Datta

    Saptarshi Datta

    A curious explorer of Technology and Life

    • Kolkata, India
    • datta.3@iitj.ac.in
    • saptarshidatta97

    Tokenizer Decoding and Sampling Strategies for Language Models

    Sample Python file

    output_ids = model.generate(input_ids, max_new_tokens=20)
    decoded_text = tokenizer.decode(output_ids[0])
    
    print("Input IDs", input_ids[0])
    print("Output IDs", output_ids)
    print(f"Generated text: {decoded_text}")
    

    Updated: October 4, 2025

    Share on

    Twitter Facebook LinkedIn
    Previous Next

    You may also enjoy

    Living In A Simulation

    The idea that we could be living in a simulation is a fascinating and complex one, often known as the simulation hypothesis. It gained popularity in recent y...

    Event Driven System Design with Azure Functions

    Events serve as the fundamental building blocks for asynchronous processing. To understand asynchronous processing, it’s essential to first differentiate bet...

    • Follow:
    • Feed
    © 2025 Saptarshi Datta. Powered by Jekyll & Minimal Mistakes.