Views
No views yet
1from transformers import pipeline
2
3model = pipeline("summarization", model="luisotorres/bart-finetuned-samsum")
4
5conversation = '''Sarah: Do you think it's a good idea to invest in Bitcoin?
6 Emily: I'm skeptical. The market is very volatile, and you could lose money.
7 Sarah: True. But there's also a high upside, right?
8'''
9model(conversation)1evaluation_strategy = "epoch",
2save_strategy = 'epoch',
3load_best_model_at_end = True,
4metric_for_best_model = 'eval_loss',
5seed = 42,
6learning_rate=2e-5,
7per_device_train_batch_size=4,
8per_device_eval_batch_size=4,
9gradient_accumulation_steps=2,
10weight_decay=0.01,
11save_total_limit=2,
12num_train_epochs=4,
13predict_with_generate=True,
14fp16=True,
15report_to="none"