Views
No views yet
google/gemma-2b-itBitsAndBytesConfigq_proj, k_proj, v_proj, o_projP_remove = 0.3) was applied to remove some of the questions containing a question mark (?), to increase the model's robustness.N=100 for training and testing).1from transformers import AutoTokenizer, AutoModelForSequenceClassification
2
3tokenizer = AutoTokenizer.from_pretrained("your_model_name")
4model = AutoModelForSequenceClassification.from_pretrained("your_model_name")
5
6inputs = tokenizer("What is the capital of France?", return_tensors="pt")
7outputs = model(**inputs)
8predictions = torch.argmax(outputs.logits, axis=1)
9
10label = "QUESTION" if predictions == 1 else "NOT_QUESTION"
11print(f"Predicted Label: {label}")