interpreter.set_tensor(input_details[0]['index'], [[co2, tvoc, temperature, humidity, pressure]]) interpreter.invoke() prediction = interpreter.get_tensor(output_details[0]['index']) return prediction[0][0] while True: co2, tvoc, temperature, humidity, pressure = read_sensor_data() if co2 is not None: aqi = predict_aqi(co2, tvoc, temperature, humidity, pressure) print(f"AQI: {aqi}") display_data(aqi) time.sleep(5)