No config.json file
#1
by
pycad
- opened
Hello,
I tried to use your model using this code:
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
# Load the tokenizer and model
model_name = "asimokby/fakeBert"
tokenizer = AutoTokenizer.from_pretrained(model_name)
model = AutoModelForSequenceClassification.from_pretrained(model_name)
# Sample text (replace this with the text you want to classify)
text = "This is a news article to detect if it's fake or real."
# Tokenize the input text
inputs = tokenizer(text, return_tensors="pt")
# Run the model
outputs = model(**inputs)
# Get predictions
logits = outputs.logits
probabilities = torch.softmax(logits, dim=-1)
predicted_class = torch.argmax(probabilities, dim=-1).item()
# Print results
if predicted_class == 1:
print("The news is fake.")
else:
print("The news is real.")
but it is saying that there is a missing file in your repo!
OSError: asimokby/fakeBert does not appear to have a file named config.json. Checkout 'https://huggingface.co/asimokby/fakeBert/tree/main' for available files.
Can you please help with this?