diff --git a/README.md b/README.md index 2bfe37e..804930e 100644 --- a/README.md +++ b/README.md @@ -307,6 +307,25 @@ Output: ), ) +### Note on use on Windows only +On Windows only, in your main starting file you need freeze_support() even if its just a python file (not the documented "only if frozen to produce an executable"). +Otherwise you can get a RuntimeError: "An attempt has been made to start a new process before the current process has finished its bootstrapping phase." +Also need to have a main function: + +```python +from relik import Relik +from relik.inference.data.objects import RelikOutput +from multiprocessing import freeze_support + +def main(): + relik = Relik.from_pretrained("sapienzanlp/relik-entity-linking-large") + relik_out: RelikOutput = relik("Michael Jordan was one of the best players in the NBA.") + +if __name__ == "__main__": + freeze_support() + main() +``` + ### CLI ReLiK provides a CLI to serve a [FastAPI](https://fastapi.tiangolo.com/) server for the model or to perform inference on a dataset.