Instructions to use Backedman/TriviaAnsweringMachine with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Backedman/TriviaAnsweringMachine 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="Backedman/TriviaAnsweringMachine", trust_remote_code=True)# pip install -U transformers accelerate # Load model directly from transformers import AutoModelForQuestionAnswering model = AutoModelForQuestionAnswering.from_pretrained("Backedman/TriviaAnsweringMachine", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
Create QBModel.py
Browse files- QBModel.py +9 -0
QBModel.py
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from transformers import PretrainedConfig
|
| 2 |
+
import torch
|
| 3 |
+
|
| 4 |
+
class QBModelConfig(PretrainedConfig):
|
| 5 |
+
model_type = 'TFIDF-QA'
|
| 6 |
+
|
| 7 |
+
def __init__(self, **kwargs):
|
| 8 |
+
self.torch_dtype = torch.float16
|
| 9 |
+
super().__init__( **kwargs)
|