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 from transformers import pipeline pipe = pipeline("question-answering", model="Backedman/TriviaAnsweringMachine", trust_remote_code=True)# 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 custom_tokenizer.py
Browse files- custom_tokenizer.py +7 -0
custom_tokenizer.py
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
class CustomTokenizer:
|
| 2 |
+
def __init__(self):
|
| 3 |
+
pass
|
| 4 |
+
|
| 5 |
+
def __call__(self, text):
|
| 6 |
+
# No tokenization, return input text as-is
|
| 7 |
+
return text
|