Hoffman-La Roche Ltd., the Canadian branch of a Swiss pharmaceutical manufacturer that produces Valium and Librium, faces an unlimited fine after being convicted under federal combines laws of trying to eliminate competition in Canada in a seven-year period.

In a 112-page judgment, Justice Allen Linden of the Supreme Court of Ontario, found that beginning in 1970 the company gave away millions of doses of Valium to hospitals and sold vast amounts in government contracts for $1 to attack competition in the tranquilizer market.

Linden says that when the company began the giveaway program it was prepared to lose $2.6 million in Valium sales to forestall a projected loss of $600,000 in sales to a competitor during the year. He says its aim could "only have been to eliminate," the competitor from the hospital market and to "warn others that they too would be eliminated if they tried to compete."

"The price was not only below cost, it was nonexistent. The purpose of such a discount could not be to engage in the kind of competition that sensible people participate in," he added.

During the seven-year period of the charge, Hoffman-La Roche sold more than 17 million units of Librium to hospitals and governments, while giving away more than 26 million units in the period.

In a four-year period covered by the charge, the firm distributed free to hospitals and governments more than 174 million units of Valium while selling 41 million units, Linden said.

The charge on the Librium indictment was dismissed. It is the first conviction under a section of Canada's Combines Investigation Act which makes it an offense to sell at unreasonably low prices if the effect is to lessen or eliminate competition through the practice known as "predatory pricing."

The legislation sets no maximum penalty and a fine will be imposed later by Linden.