Sharathhebbar24 commited on
Commit
79e3676
·
verified ·
1 Parent(s): c814dcf

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +36 -1
README.md CHANGED
@@ -3,4 +3,39 @@ datasets:
3
  - databricks/databricks-dolly-15k
4
  - gamino/wiki_medical_terms
5
  - Sharathhebbar24/openhermes
6
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  - databricks/databricks-dolly-15k
4
  - gamino/wiki_medical_terms
5
  - Sharathhebbar24/openhermes
6
+ ---
7
+
8
+
9
+ This model is a finetuned version of ```gpt2-medium``` using ```databricks/databricks-dolly-15k dataset```
10
+
11
+ ## Model description
12
+
13
+ GPT-2 is a transformers model pre-trained on a very large corpus of English data in a self-supervised fashion. This
14
+ means it was pre-trained on the raw texts only, with no humans labeling them in any way (which is why it can use lots
15
+ of publicly available data) with an automatic process to generate inputs and labels from those texts. More precisely,
16
+ it was trained to guess the next word in sentences.
17
+
18
+ More precisely, inputs are sequences of continuous text of a certain length and the targets are the same sequence,
19
+ shifting one token (word or piece of word) to the right. The model uses a masking mechanism to make sure the
20
+ predictions for the token `i` only use the inputs from `1` to `i` but not the future tokens.
21
+
22
+ This way, the model learns an inner representation of the English language that can then be used to extract features
23
+ useful for downstream tasks. The model is best at what it was trained for, however, which is generating texts from a
24
+ prompt.
25
+
26
+ ### To use this model
27
+
28
+ ```python
29
+ >>> from transformers import AutoTokenizer, AutoModelForCausalLM
30
+ >>> model_name = "Sharathhebbar24/Instruct_GPT"
31
+ >>> model = AutoModelForCausalLM.from_pretrained(model_name)
32
+ >>> tokenizer = AutoTokenizer.from_pretrained("gpt2-medium")
33
+ >>> def generate_text(prompt):
34
+ >>> inputs = tokenizer.encode(prompt, return_tensors='pt')
35
+ >>> outputs = model.generate(inputs, max_length=64, pad_token_id=tokenizer.eos_token_id)
36
+ >>> generated = tokenizer.decode(outputs[0], skip_special_tokens=True)
37
+ >>> return generated[:generated.rfind(".")+1]
38
+
39
+ >>> generate_text("Should I Invest in stocks")
40
+
41
+ ```