Sandiago21 commited on
Commit
309db04
1 Parent(s): 2dd994b

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +39 -0
README.md CHANGED
@@ -19,12 +19,18 @@ Finetuned depacoda-research/llamma-13b-hf on conversations
19
  The depacoda-research/llamma-13b-hf model was finetuned on conversations and question answering prompts
20
 
21
  **Developed by:** [More Information Needed]
 
22
  **Shared by:** [More Information Needed]
 
23
  **Model type:** Causal LM
 
24
  **Language(s) (NLP):** English, multilingual
 
25
  **License:** Research
 
26
  **Finetuned from model:** depacoda-research/llamma-13b-hf
27
 
 
28
  ## Model Sources [optional]
29
 
30
  **Repository:** [More Information Needed]
@@ -67,6 +73,39 @@ model = LlamaForCausalLM.from_pretrained(MODEL_NAME, load_in_8bit=True, device_m
67
  model = PeftModel.from_pretrained(model, "Sandiago21/public-ai-model")
68
  ```
69
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
  ## Training Details
71
 
72
 
 
19
  The depacoda-research/llamma-13b-hf model was finetuned on conversations and question answering prompts
20
 
21
  **Developed by:** [More Information Needed]
22
+
23
  **Shared by:** [More Information Needed]
24
+
25
  **Model type:** Causal LM
26
+
27
  **Language(s) (NLP):** English, multilingual
28
+
29
  **License:** Research
30
+
31
  **Finetuned from model:** depacoda-research/llamma-13b-hf
32
 
33
+
34
  ## Model Sources [optional]
35
 
36
  **Repository:** [More Information Needed]
 
73
  model = PeftModel.from_pretrained(model, "Sandiago21/public-ai-model")
74
  ```
75
 
76
+ ### Example of Usage
77
+ ```
78
+ from transformers import GenerationConfig
79
+
80
+ PROMPT = """Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.\n\n### Instruction:\nWhich is the capital city of Greece and with which countries does Greece border?\n\n### Input:\nQuestion answering\n\n### Response:\n"""
81
+ DEVICE = "cuda"
82
+
83
+ inputs = tokenizer(
84
+ PROMPT,
85
+ return_tensors="pt",
86
+ )
87
+
88
+ input_ids = inputs["input_ids"].to(DEVICE)
89
+
90
+ generation_config = GenerationConfig(
91
+ temperature=0.1,
92
+ top_p=0.95,
93
+ repetition_penalty=1.2,
94
+ )
95
+
96
+ print("Generating Response ... ")
97
+ generation_output = model.generate(
98
+ input_ids=input_ids,
99
+ generation_config=generation_config,
100
+ return_dict_in_generate=True,
101
+ output_scores=True,
102
+ max_new_tokens=256,
103
+ )
104
+
105
+ for s in generation_output.sequences:
106
+ print(tokenizer.decode(s))
107
+ ```
108
+
109
  ## Training Details
110
 
111