The modern cotton gin was invented by the American inventor Eli Whitney . The modern version of the cotton gin was created by the American inventor Eli Whitney in 1793 to mechanize the cleaning of cotton .