Stanlito commited on
Commit
3cfa49d
1 Parent(s): f1ac9b1

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +61 -1
README.md CHANGED
@@ -13,4 +13,64 @@ metrics:
13
  - accuracy
14
  - code_eval
15
  pipeline_tag: text-generation
16
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
13
  - accuracy
14
  - code_eval
15
  pipeline_tag: text-generation
16
+ ---
17
+
18
+
19
+
20
+
21
+
22
+ # 🦙🧠 guanaco-llama2-1k
23
+
24
+ <center><img src="https://i.imgur.com/1IZmjU4.png" width="300"></center>
25
+
26
+ This is a `Llama-2-7b-chat-hf` model fine-tuned using QLoRA (4-bit precision) on the [`mlabonne/guanaco-llama2-1k`](https://huggingface.co/datasets/mlabonne/guanaco-llama2-1k) dataset, which is a subset of the [`timdettmers/openassistant-guanaco`](https://huggingface.co/datasets/timdettmers/openassistant-guanaco).
27
+
28
+ ## 🔧 Training
29
+
30
+ It was trained on a Google Colab notebook with a T4 GPU and high RAM. It is mainly designed for educational purposes, not for inference.
31
+
32
+ ## 💻 Usage
33
+
34
+ ``` python
35
+ # pip install transformers accelerate
36
+ from transformers import AutoTokenizer
37
+ import transformers
38
+ import torch
39
+ model = "mlabonne/llama-2-7b-stanlito"
40
+ prompt = "What is a large language model?"
41
+ tokenizer = AutoTokenizer.from_pretrained(model)
42
+ pipeline = transformers.pipeline(
43
+ "text-generation",
44
+ model=model,
45
+ torch_dtype=torch.float16,
46
+ device_map="auto",
47
+ )
48
+ sequences = pipeline(
49
+ f'<s>[INST] {prompt} [/INST]',
50
+ do_sample=True,
51
+ top_k=10,
52
+ num_return_sequences=1,
53
+ eos_token_id=tokenizer.eos_token_id,
54
+ max_length=200,
55
+ )
56
+ for seq in sequences:
57
+ print(f"Result: {seq['generated_text']}")
58
+ ```
59
+
60
+ Output:
61
+ > A large language model is trained on massive amounts of text data to understand and generate human language. The model learns by predicting the next word in a sequence based on the context of the previous words. This process allows the language model to learn patterns, rules, and relationships within the language that allow it to generate text that looks and sounds authentic and coherent. These large language models are used for many applications, such as language translation, sentiment analysis, and language generation. These models can also be used to generate text summaries of complex documents, such as legal or scientific papers, or to generate text summaries of social media posts. These models are often used in natural language processing (NLP) and machine learning applications.
62
+ > The large language models are trained using a large number of parameters, often in the billions or even in the tens of billions.
63
+
64
+
65
+
66
+
67
+
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+