The number of fire escapes to be attached to any one building, as required in this chapter, shall, when the building is located within a city, be determined by the commissioner or superintendent of public buildings within such city, and if there be no such officer in such city, then by the chief of the fire department of such city; provided, however, that all buildings of nonfireproof construction three or more stories in height, used for manufacturing purposes, hotels, dormitories, schools, seminaries, hospitals or asylums, shall have not less than one fire escape for every fifty persons or fraction thereof, for whom working, sleeping or living accommodations are provided above the second story, and all public halls which provide seating room above the first or ground story, shall have such number of fire escapes as shall not be less than one fire escape for every one hundred persons, calculated on the seating capacity of the hall, unless a different number is authorized in writing by the commissioner, or superintendent of buildings, or the chief of the fire department, or the sheriff of the county, as the case may be.