jjae commited on
Commit
67c22b9
·
verified ·
1 Parent(s): 77a961f

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +22 -5
README.md CHANGED
@@ -9,8 +9,7 @@ model-index:
9
  results: []
10
  ---
11
 
12
- <!-- This model card has been generated automatically according to the information the Trainer had access to. You
13
- should probably proofread and complete it, then remove this comment. -->
14
 
15
  # modelling
16
 
@@ -20,15 +19,16 @@ It achieves the following results on the evaluation set:
20
 
21
  ## Model description
22
 
23
- More information needed
24
 
25
  ## Intended uses & limitations
26
 
27
- More information needed
28
 
29
  ## Training and evaluation data
30
 
31
- More information needed
 
32
 
33
  ## Training procedure
34
 
@@ -61,3 +61,20 @@ The following hyperparameters were used during training:
61
  - Pytorch 2.1.2+cu118
62
  - Datasets 2.16.1
63
  - Tokenizers 0.15.0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  results: []
10
  ---
11
 
12
+
 
13
 
14
  # modelling
15
 
 
19
 
20
  ## Model description
21
 
22
+ This model generates hash tag from input text.
23
 
24
  ## Intended uses & limitations
25
 
26
+
27
 
28
  ## Training and evaluation data
29
 
30
+ This model was trained by the self-instruction process.
31
+ All data used for fine-tuning this model were generated by chatGPT 3.5.
32
 
33
  ## Training procedure
34
 
 
61
  - Pytorch 2.1.2+cu118
62
  - Datasets 2.16.1
63
  - Tokenizers 0.15.0
64
+
65
+
66
+ ### How to Get Started with the Model
67
+ Use the code below to get started with the model.
68
+ '''
69
+ from transformers import PreTrainedTokenizerFast, BartForConditionalGeneration
70
+ model_name = "jjae/kobart-hashtag"
71
+ tokenizer = PreTrainedTokenizerFast.from_pretrained(model_name)
72
+ model = BartForConditionalGeneration.from_pretrained(model_name)
73
+
74
+ def make_tag(text):
75
+ input_ids = tokenizer.encode(text, return_tensors="pt").to(device)
76
+ output = model.generate(input_ids = input_ids, bos_token_id = model.config.bos_token_id,
77
+ eos_token_id = model.config.eos_token_id, length_penalty = 2.0, max_length = 50, num_beams = 2)
78
+ decoded_output = tokenizer.decode(output[0], skip_special_tokens=True)
79
+ return decoded_output
80
+ '''