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 +6 -0
qbmodel.py
CHANGED
|
@@ -67,6 +67,12 @@ class QuizBowlModel:
|
|
| 67 |
# Create respective model if not exist
|
| 68 |
if not clear:
|
| 69 |
for category in range(len(self.categories)):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 70 |
if self.tfidf_models[category] is None:
|
| 71 |
self.tfidf_models[category] = NLPModel().load(f"models/{self.categories[category]}_tfidf.pkl")
|
| 72 |
|
|
|
|
| 67 |
# Create respective model if not exist
|
| 68 |
if not clear:
|
| 69 |
for category in range(len(self.categories)):
|
| 70 |
+
|
| 71 |
+
REPO_ID = 'Backedman/TriviaAnsweringMachineREAL'
|
| 72 |
+
FILENAME = f"models/{self.categories[category]}_tfidf.pkl"
|
| 73 |
+
|
| 74 |
+
hf_hub_download(repo_id=REPO_ID, filename=FILENAME, local_dir='.')
|
| 75 |
+
|
| 76 |
if self.tfidf_models[category] is None:
|
| 77 |
self.tfidf_models[category] = NLPModel().load(f"models/{self.categories[category]}_tfidf.pkl")
|
| 78 |
|