PHILADELPHIA (AP) _ The sweet aroma of candy still hangs in the air at the Whitman's Chocolate Factory. But it is a bittersweet week for Philadelphia, as a tradition that began in 1842 with one man's confectionery comes to an end.

The factory that for 30 years turned out box after all-purpose box of Whitman's Samplers - suitable for Mother's Day, a get-well gift or sweet-tooth binge - is being auctioned off piece by piece, like Vanilla Butter Creams, Nut Crunch Cups and Marshmallow Mint Jells plucked from their compartments.

''I feel like an undertaker who knew the deceased,'' said Sid Dvorak, a Philadelphia native who bought the building from Pet Inc., which had owned Whitman's for 30 years.

However, the yellow box featuring more than a dozen varieties of chocolates will live on.

Russell Stover, Whitman's chief competitor in the gift-chocolate market, paid Pet $35 million last spring for the Whitman name and contents of the factory.

The flagship product will be manufactured from now on in Abilene, Kan., by a new Stover subsidiary called Whitman's Candies Inc.

The Philadelphia plant's machinery is idle now, and the factory's 700 workers, laid off in June, have gone home. Most of the one-story building is silent except for bidders plotting their next moves in whispers.

On the main assembly line, they can't get the smell of chocolate out and probably never will. But what once pumped out the popular morsels is now labeled for auction, wiped clean of sweet stickiness and ready to move out.

Cordial Cherry and Almond Truffle molds by the thousands? Going once.

Barrel-sized kettles and empty chocolate racks? Going twice.

Contraptions with names like ''Otto Hansel Boxline-Chocofil Setup Station?'' Sold 3/8

''It's a bonanza,'' one bidder, presumably a chocolate manufacturer, said Tuesday.

Not for northeast Philadelphia, it isn't.

It's the latest economic blow to the area, which lost 504 jobs when Mrs. Paul's Kitchens, a manufacturer of fish sticks, left in July. Sears, Roebuck & Co., a Sealtest dairy operation and a 3M Co. plant also have joined the exodus.

''There really has been a negative effect in some of this conglomerate diversification,'' said John L. Stanton, a professor of food marketing at St. Joseph's University.

''The people who owned Whitman lived in Philadelphia, worked in Philadelphia, were part of Philadelphia. This was everything to them and there was a specialness about it.''

Confectioner Stephen F. Whitman founded the company in 1842 when he set up a shop near the waterfront and began buying exotic candy ingredients from sailors. The Sampler first was marketed in 1912 with its trademark cross- stitch. At its height, the company sold up to 12 million boxes a year.

Pet Milk, later known as Pet Inc., bought the company in 1963, two years after the northeast Philadelphia plant was completed. But profits fell, and Russell Stover announced plans to buy the name and assets in March.

The state attorney general sued in April to block the deal, arguing it would violate antitrust law. But a judge disagreed.

Pet, it seems, is trying to keep a low profile as it leaves. Photographers aren't allowed inside, and reporters are barred from interviewing bidders. The auction continues through Thursday.

Stanton, who testified against the sale in court, said the factory's demise came not because it produced a bad product, but because it went from a locally managed operation to a corporate subsidiary.

''But look at the good side,'' he said. ''At least the Whitman's Sampler will still exist. Whitman could have disappeared. Now it'll still be around. It just won't be the old Philadelphia tradition.''