Merged new QueryFormer changes with new UI code