Skip to content
Snippets Groups Projects
Commit b7a9bc0a authored by kulcsar's avatar kulcsar
Browse files

update demo

parent 5ce419a1
No related branches found
No related tags found
No related merge requests found
......@@ -20,8 +20,9 @@ label = int(input())
data_sample = {"sentence": sentence, "pos": target_pos, "label": label}
print(data_sample)
tokenizer=AutoTokenizer.from_pretrained("bert-base-uncased")
input_as_dataset=preprocess.tokenizer_new(tokenizer, data_sample, max_length=512)
# Load model
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
......@@ -29,7 +30,7 @@ model=models.BertForWordClassification.from_pretrained("bert-base-uncased")
model_path = "saved_models/bert_baseline.pth"
model = torch.load(model_path, map_location=device)
tokenizer=AutoTokenizer.from_pretrained("bert-base-uncased")
train_sampler = RandomSampler(data_sample)
train_dataloader=DataLoader(data_sample, sampler=train_sampler, batch_size=1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment