Instructions to use nlpconnect/roberta-base-squad2-nq with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nlpconnect/roberta-base-squad2-nq with Transformers:
# Use a pipeline as a high-level helper # Warning: Pipeline type "question-answering" is no longer supported in transformers v5. # You must load the model directly (see below) or downgrade to v4.x with: # pip install "transformers<5.0.0" from transformers import pipeline pipe = pipeline("question-answering", model="nlpconnect/roberta-base-squad2-nq")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForQuestionAnswering tokenizer = AutoTokenizer.from_pretrained("nlpconnect/roberta-base-squad2-nq") model = AutoModelForQuestionAnswering.from_pretrained("nlpconnect/roberta-base-squad2-nq", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Download config.json from nlpconnect/roberta-base-squad2-nq: direct link, hf CLI and curl.
- Browser
- Download file 621 Bytes
-
https://huggingface.co/nlpconnect/roberta-base-squad2-nq/resolve/refs%2Fpr%2F4/config.json
- Command line
-
hf download hf://nlpconnect/roberta-base-squad2-nq@refs/pr/4/config.json
-
curl -L -o config.json https://huggingface.co/nlpconnect/roberta-base-squad2-nq/resolve/refs%2Fpr%2F4/config.json
621 Bytes
| { | |
| "_name_or_path": "deepset/roberta-base-squad2", | |
| "architectures": [ | |
| "RobertaForQuestionAnswering" | |
| ], | |
| "attention_probs_dropout_prob": 0.1, | |
| "bos_token_id": 0, | |
| "eos_token_id": 2, | |
| "gradient_checkpointing": false, | |
| "hidden_act": "gelu", | |
| "hidden_dropout_prob": 0.1, | |
| "hidden_size": 768, | |
| "initializer_range": 0.02, | |
| "intermediate_size": 3072, | |
| "language": "english", | |
| "layer_norm_eps": 1e-05, | |
| "max_position_embeddings": 514, | |
| "model_type": "roberta", | |
| "name": "Roberta", | |
| "num_attention_heads": 12, | |
| "num_hidden_layers": 12, | |
| "pad_token_id": 1, | |
| "type_vocab_size": 1, | |
| "vocab_size": 50265 | |
| } | |