TFS-v0.2 / README.md
kst23's picture
Update README.md
e1c9744 verified
|
raw
history blame
856 Bytes

TFS v0.2 | THINKING FAST AND SLOW

TFS is a classification model trained on over 5 million entries to classify the given sequences into:

  • <fast_thinking>
  • <slow_thinking>
  • <calculative_thinking>

from transformers import AutoModelForSequenceClassification, AutoTokenizer
import torch

model_id = "brahmairesearch/TFS-v0.2"
model = AutoModelForSequenceClassification.from_pretrained(model_id)
tokenizer = AutoTokenizer.from_pretrained(model_id)

def classify(sequence):
    inputs = tokenizer(sequence, return_tensors="pt")
    with torch.no_grad():
        logits = model(**inputs).logits
    predicted_class_id = logits.argmax().item()
    print(model.config.id2label[predicted_class_id])


classify("How many R are there in STRAWBERRY?")
# <calculative_thinking>

DO NOT OPENSOURCE ### | BRAHMAI