The problem is likely in the wiring harness, the controller or possibly the display. A loose throttle ground connection or a short in the wiring harness will cause uncontrolled acceleration. You can check this by putting the bike on a work stand or blocking the rear wheel off the ground. power up the bike and manipulate the wiring harness with your fingers, particularly near the connectors. MAKE SURE THE REAR WHEEL IS OFF THE GROUND BEFORE TRYING THIS! If the motor activates while doing this, you have a bad connection. If you can isolate it to the wiring, the fix may require fine soldering or replacing that section of the wiring harness.
Some bikes, including Pedego, were recalled for this problem. You might contact the bike maker to see if this is a known issue and what they recommend.