Example for Using GPU
Hi Folks,
I've been trying to get this running on a g4dn.2xlarge on EC2 for hours with zero success.
Everytime I load the model via from_pretrained, it looks like defaults to CPU. I've tried passing in parameters like so:
```
relik_model = Relik.from_pretrained("sapienzanlp/relik-entity-linking-small",device="cuda",overrides={"device":"cuda"})
relik_relationships = Relik.from_pretrained("sapienzanlp/relik-relation-extraction-nyt-large",device="cuda",overrides={"device":"cuda"})
```
But that doesn't seem to work either:
I still see:
`[relik.retriever.indexers.base.from_pretrained:485] [PID:1605] [RANK:0] {
'_target_': 'relik.retriever.indexers.inmemory.InMemoryDocumentIndex',
'device': 'cpu',
'metadata_fields': ['definition'],
'name_or_path': None,
'precision': None,
'separator': ' <def> ',
'use_faiss': False,
}`
I'm using Amazon's Deep Learning AMI for Ubuntu. Any advice would be appreciated -- I'm a bit of a newb.
Thanks!
关闭于 2025-02-15 0 条评论