omidvaramin commited on
Commit
14b996c
1 Parent(s): 744e875

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +4 -0
README.md CHANGED
@@ -16,6 +16,8 @@ You can use this model for headline generation task on English news articles.
16
 
17
  ### Usage
18
  ```python
 
 
19
  article = """Two of the OPEC oil cartel’s 11 members, Nigeria and Venezuela, said today that they would voluntarily cut production in response to declining crude oil prices, which have fallen 20 percent from their peak two months ago.
20
 
21
  The move, which would take less than 200,000 barrels of oil a day off the market, follows days of mixed signals from some OPEC officials, who have voiced increasing concern about the rapid drop in prices. Nigeria’s oil minister, Edmund Daukoru, who is president of OPEC this year, recently said the price of oil was “very low.”
@@ -48,6 +50,8 @@ from transformers import AutoModelWithLMHead,AutoModelForSeq2SeqLM, DataCollator
48
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
49
  print(device)
50
 
 
 
51
 
52
  model = AutoModelForSeq2SeqLM.from_pretrained("omidvaramin/Hprophetnet-large").to(device)
53
  tokenizer = AutoTokenizer.from_pretrained("omidvaramin/Hprophetnet-large")
 
16
 
17
  ### Usage
18
  ```python
19
+
20
+
21
  article = """Two of the OPEC oil cartel’s 11 members, Nigeria and Venezuela, said today that they would voluntarily cut production in response to declining crude oil prices, which have fallen 20 percent from their peak two months ago.
22
 
23
  The move, which would take less than 200,000 barrels of oil a day off the market, follows days of mixed signals from some OPEC officials, who have voiced increasing concern about the rapid drop in prices. Nigeria’s oil minister, Edmund Daukoru, who is president of OPEC this year, recently said the price of oil was “very low.”
 
50
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
51
  print(device)
52
 
53
+ #appending the task identifier to the beginning of input
54
+ article = "Headline: " + article
55
 
56
  model = AutoModelForSeq2SeqLM.from_pretrained("omidvaramin/Hprophetnet-large").to(device)
57
  tokenizer = AutoTokenizer.from_pretrained("omidvaramin/Hprophetnet-large")