#8201·flower

[Bug]: Undefined Variable global_model in Code Example

Author: ronodhirSoumikCreated Sep 18, 2026Updated Sep 18, 2026

Describe the bug

In a code snippet in Upgrade to Message API,

    # Defined model to federate and extract parameters
    model = MyModel()
    arrays = ArrayRecord(global_model.state_dict())

The variable is defined as model on first line, but in second line it references global_model, which is never defined anywhere in the code example. A user copying this example would get a undefined var global_model error.

Love to add the fix for this.

Steps/Code to Reproduce

Documentation page - [Upgrade to Message API](https://flower.ai/docs/framework/how-to-upgrade-to-message-api.html

Expected Results

Expected value in the code snippet

    # Defined model to federate and extract parameters
    model = MyModel()
    arrays = ArrayRecord(model.state_dict())

Actual Results

Variable declaration was wrong in code snippet.