abertsch72 / unlimiformer

Public repo for the NeurIPS 2023 paper "Unlimiformer: Long-Range Transformers with Unlimited Length Input"
MIT License
1.05k stars 77 forks source link

knn_args, unlimiformer_args, tokenizer is not defined #32

Closed laeljh closed 7 months ago

laeljh commented 1 year ago

Hi, I'm trying to deploy unlimiformer on my local machine. I cloned src folder into my source folder and installed the dependencies. When I open usage.py I see a bunch of problems: image image

What am I missing here? I followed the instructions in the repo.

abertsch72 commented 11 months ago

Hi @laeljh -- thanks for the interest in our work!

The function in usage.py is an example of a code snippet you could add in to your own training pipeline to integrate Unlimiformer. You'd have to instantiate your own UnlimiformerArguments object with the arguments you intend to use, and that would be the unlimiformer_args variable that you'd use with this logic. (The mention of knn_args is a mistake, though-- I've updated that to also be unlimiformer_args. )

If you want to work from a more self-contained example, you can try using run.py or inference_example.py using these instructions.