Skip to content

Commit

Permalink
update gptq tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
irenaby committed Jul 2, 2024
1 parent 7a72ff3 commit b8237b3
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,7 @@
"GPTQ is a gradient-based optimization process, which requires representative dataset to perform inference and compute gradients. It is possible to define a separate representative dataset in addition to the one used for the PTQ statistics collection. A possible reason to do so is, for example, to use a larger dataset in the optimization process.\n",
"\n",
"In this tutorial we use the same representative dataset for both statistics collection and GPTQ. \n",
"A complete pass through the representative dataset generator constitutes an epoch (batch_size x n_iter samples).\n",
"In this example we use the same dataloader iterator for all epochs, i.e. different images are used in different epochs."
"A complete pass through the representative dataset generator constitutes an epoch (batch_size x n_iter samples)."
]
},
{
Expand All @@ -193,9 +192,9 @@
"n_iter = 10\n",
"\n",
"dataloader = DataLoader(dataset, batch_size=batch_size, shuffle=True)\n",
"dataloader_iter = iter(dataloader)\n",
"\n",
"def representative_dataset_gen():\n",
" dataloader_iter = iter(dataloader)\n",
" for _ in range(n_iter):\n",
" yield [next(dataloader_iter)[0]]\n"
]
Expand Down

0 comments on commit b8237b3

Please sign in to comment.