Token Classification
Transformers
PyTorch
English
roberta
keyphrase-extraction
Eval Results (legacy)
Instructions to use ml6team/keyphrase-extraction-kbir-kpcrowd with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ml6team/keyphrase-extraction-kbir-kpcrowd with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("token-classification", model="ml6team/keyphrase-extraction-kbir-kpcrowd")# Load model directly from transformers import AutoTokenizer, AutoModelForTokenClassification tokenizer = AutoTokenizer.from_pretrained("ml6team/keyphrase-extraction-kbir-kpcrowd") model = AutoModelForTokenClassification.from_pretrained("ml6team/keyphrase-extraction-kbir-kpcrowd") - Notebooks
- Google Colab
- Kaggle
How to set gpu device when doing inference
#1
by sersoage - opened
Hi I am trying to use your models and unable to use and specific gpu when doing inference? could you point to a resource to do so?
Thanks!
Hey!
Well, you can specify the device parameter in the pipeline function. More information here: https://huggingface.co/docs/transformers/main_classes/pipelines#transformers.pipeline.device.
This worked for me:
extractor = KeyphraseExtractionPipeline(model=model_name, device=0)
Please check that you have installed PyTorch for GPU. Otherwise here is the link: https://pytorch.org/get-started/locally/.
Hope this helps!