Specific steps:
When the mobile phone is turned off, press and hold the volume down+power button to enter the quick start mode, and connect the USB of the mobile phone to the computer.
After downloading the complete package, double-click Run Decompression to open the complete package folder.
MIUI7 stable version of Xiaomi 5, or the development version of rom package, line brush, or card brush can be used. If your BL is unlocked, it is recommended to swipe your card so that your backup will not be lost.
After downloading the brush tool, unzip the installation (if prompted by the system security, please select Allow Installation), open the MiFlash.exe, and paste the copied contents into the blue area.
Click Refresh, and the program will automatically recognize the phone. Click on the brush and start brushing.
If the prompt operation is successful, it means that the machine has been successfully brushed and will start automatically. Note that the boot time may be longer than the general boot time, so wait patiently. After completing the above operations, it has been successfully downgraded from MIUI8 to MIUI7.