Instructions to use Backedman/TriviaAnsweringMachineREAL with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Backedman/TriviaAnsweringMachineREAL with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("question-answering", model="Backedman/TriviaAnsweringMachineREAL", trust_remote_code=True)# Load model directly from transformers import AutoModelForQuestionAnswering model = AutoModelForQuestionAnswering.from_pretrained("Backedman/TriviaAnsweringMachineREAL", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
Update qbmodel.py
Browse files- qbmodel.py +1 -2
qbmodel.py
CHANGED
|
@@ -1,7 +1,6 @@
|
|
| 1 |
from typing import List, Tuple
|
| 2 |
import nltk
|
| 3 |
import sklearn
|
| 4 |
-
import question_categorizer as qc
|
| 5 |
from .question_categorizer import TextClassificationModel
|
| 6 |
from .tfidf_model import NLPModel
|
| 7 |
import transformers
|
|
@@ -27,7 +26,7 @@ class QuizBowlModel:
|
|
| 27 |
|
| 28 |
self.categories = ['Geography', 'Religion', 'Philosophy', 'Trash','Mythology', 'Literature','Science', 'Social Science', 'History', 'Current Events', 'Fine Arts']
|
| 29 |
self.tfidf_models = [None for _ in range(len(self.categories))]
|
| 30 |
-
self.qc_model =
|
| 31 |
|
| 32 |
self.load_tfidf_models(clear=clear)
|
| 33 |
|
|
|
|
| 1 |
from typing import List, Tuple
|
| 2 |
import nltk
|
| 3 |
import sklearn
|
|
|
|
| 4 |
from .question_categorizer import TextClassificationModel
|
| 5 |
from .tfidf_model import NLPModel
|
| 6 |
import transformers
|
|
|
|
| 26 |
|
| 27 |
self.categories = ['Geography', 'Religion', 'Philosophy', 'Trash','Mythology', 'Literature','Science', 'Social Science', 'History', 'Current Events', 'Fine Arts']
|
| 28 |
self.tfidf_models = [None for _ in range(len(self.categories))]
|
| 29 |
+
self.qc_model = TextClassificationModel.load_model("models/categorizer")
|
| 30 |
|
| 31 |
self.load_tfidf_models(clear=clear)
|
| 32 |
|