dartpain commited on
Commit
e9b254f
1 Parent(s): fff33c0

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +154 -1
README.md CHANGED
@@ -4,4 +4,157 @@ language:
4
  - en
5
  library_name: transformers
6
  pipeline_tag: text-generation
7
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  - en
5
  library_name: transformers
6
  pipeline_tag: text-generation
7
+ ---
8
+
9
+
10
+ This model is fine tuned on top of falcon-7b-instruct
11
+
12
+ DocsGPT is optimized for Documentation: Specifically fine-tuned for providing answers that are based on documentation provided in context, making it particularly useful for developers and technical support teams.
13
+
14
+ We used 50k high quality examples to finetune it over 2 days on A10G GPU.
15
+ We used lora fine tuning process.
16
+
17
+ Its an apache-2.0 license so you can use it for commercial purposes too.
18
+
19
+
20
+ # How to run it
21
+ ```
22
+ from transformers import AutoTokenizer, AutoModelForCausalLM
23
+ import transformers
24
+ import torch
25
+
26
+ model = "Arc53/docsgpt-7b-falcon"
27
+
28
+ tokenizer = AutoTokenizer.from_pretrained(model)
29
+ pipeline = transformers.pipeline(
30
+ "text-generation",
31
+ model=model,
32
+ tokenizer=tokenizer,
33
+ torch_dtype=torch.bfloat16,
34
+ trust_remote_code=True,
35
+ device_map="auto",
36
+ )
37
+ sequences = pipeline(
38
+ "Girafatron is obsessed with giraffes, the most glorious animal on the face of this Earth. Giraftron believes all other animals are irrelevant when compared to the glorious majesty of the giraffe.\nDaniel: Hello, Girafatron!\nGirafatron:",
39
+ max_length=200,
40
+ do_sample=True,
41
+ top_k=10,
42
+ num_return_sequences=1,
43
+ eos_token_id=tokenizer.eos_token_id,
44
+ )
45
+ for seq in sequences:
46
+ print(f"Result: {seq['generated_text']}")
47
+ ```
48
+
49
+
50
+ Benchmarks are still WIP
51
+
52
+
53
+
54
+ To prepare your prompts make sure you keep this format:
55
+
56
+ ```
57
+ ### Instruction
58
+ (where the question goes)
59
+ ### Context
60
+ (your document retrieval + system instructions)
61
+ ### Answer
62
+ ```
63
+
64
+
65
+ Here is an example comparing it to tiiuae/falcon-7b-instruct
66
+
67
+ Prompt:
68
+ ```
69
+ ### Instruction
70
+ How to cook pasta?
71
+
72
+ ### Context
73
+ You are a DocsGPT, friendly and helpful AI assistant by Arc53 that provides help with documents. You give thorough answers with code examples if possible.
74
+ Use the following pieces of context to help answer the users question. If its not relevant to the question, provide friendly responses.
75
+ You have access to chat history, and can use it to help answer the question.
76
+ ----------------
77
+
78
+ Equipment:
79
+
80
+ Large pot
81
+ Colander or strainer
82
+ Timer
83
+ Wooden spoon or pasta fork
84
+
85
+ Instructions:
86
+
87
+ Boil Water:
88
+ Fill a large pot with water. You'll need about 4-6 quarts (16-24 cups) of water for every pound of pasta.
89
+ Place the pot on the stove over high heat and cover it with a lid. This will help the water come to a boil faster.
90
+
91
+ Add Salt:
92
+ Once the water reaches a rolling boil, add salt to the water. Use about 1-2 tablespoons of salt per gallon of water. This enhances the pasta's flavor.
93
+
94
+ Add Pasta:
95
+ Add the pasta to the boiling water. Stir gently to prevent the pasta from sticking together. Use a pasta fork or wooden spoon to stir.
96
+
97
+ Cooking Time:
98
+ Follow the package instructions for cooking time. Most pasta takes around 8-12 minutes to cook. Set a timer according to the shorter end of the suggested cooking time range.
99
+
100
+ Stirring:
101
+ Stir the pasta occasionally while it's cooking. This helps prevent sticking and ensures even cooking.
102
+
103
+ Taste Testing:
104
+ Around 2 minutes before the timer goes off, start tasting the pasta. It should be "al dente," meaning it's cooked but still slightly firm when bitten.
105
+
106
+ Draining:
107
+ When the pasta is al dente, turn off the heat and carefully pour the pasta and water through a colander or strainer to separate the pasta from the water. Be sure to save a small amount of pasta water if you're making a sauce.
108
+
109
+ Optional: Olive Oil:
110
+ You can toss the drained pasta with a small amount of olive oil to prevent sticking. This step is optional but can be useful.
111
+
112
+ Serving:
113
+ Serve the cooked pasta immediately with your choice of sauce, toppings, or ingredients. Common choices include tomato sauce, Alfredo sauce, pesto, or sautéed vegetables.
114
+
115
+
116
+
117
+ ### Answer
118
+ ```
119
+
120
+
121
+ docsgpt-7b-falcon:
122
+ ```
123
+ To cook pasta, you will need the following equipment:
124
+
125
+ 1. Large pot: This is where you will boil the water for the pasta.
126
+ 2. Colander or strainer: This is used to drain the pasta after boiling.
127
+ 3. Timer: This is used to keep track of the cooking time.
128
+ 4. Wooden spoon or pasta fork: These are used to stir the pasta while it's cooking.
129
+
130
+ Here are the steps to cook pasta:
131
+
132
+ 1. Fill the large pot with water: The water should cover the pasta completely.
133
+ 2. Add salt: Add salt to the water to enhance the flavor of the pasta.
134
+ 3. Add the pasta: Add the pasta to the boiling water. Use a pasta fork or wooden spoon to stir gently to prevent the pasta from sticking together.
135
+ 4. Cooking time: Follow the package instructions for cooking time. Most pasta takes around 8-12 minutes to cook. Set a timer according to the shorter end of the suggested cooking time range.
136
+ 5. Stirring: Stir the pasta occasionally while it's cooking. This helps prevent sticking and ensures even cooking.
137
+ 6. Taste testing: Taste the pasta around 2 minutes before the timer goes off. It should be "al dente," meaning it's cooked but still slightly firm when bitten.
138
+ 7. Draining: Carefully pour the pasta and water through a colander or strainer to separate the pasta from the water. Be sure to save a small amount of pasta water if you're making a sauce.
139
+ 8. Optional: Olive oil: You can toss the drained pasta with a small amount of olive oil to prevent sticking. This step is optional but can be useful.
140
+ 9. Serving: Serve the cooked pasta immediately with your choice of sauce, toppings, or ingredients. Common choices include tomato sauce, Alfredo sauce, pesto, or sautéed vegetables.
141
+
142
+ Remember to always follow the instructions on the package and use caution when handling hot liquids.
143
+ ```
144
+
145
+ The original tiiuae/falcon-7b-instruct:
146
+ ```
147
+ To cook pasta, follow these steps:
148
+ 1. Fill a large pot with water and place it on the stove over high heat.
149
+ 2. Cover the pot with a lid and bring the water to a boil.
150
+ 3. Add salt to the water and stir to enhance the pasta's flavor.
151
+ 4. Add the pasta to the boiling water and stir gently to prevent sticking.
152
+ 5. Cooking time varies depending on the type of pasta, but it typically takes around 8-12 minutes.
153
+ 6. Stir the pasta occasionally while it's cooking.
154
+ 7. Taste the pasta around 2 minutes before the timer goes off to check for doneness.
155
+ 8. Drain the pasta and save a small amount of pasta water for a sauce.
156
+ 9. Optional: Toss the drained pasta with olive oil to prevent sticking.
157
+ 10. Serve the cooked pasta immediately with your choice of sauce, toppings, or ingredients.
158
+ ```
159
+
160
+ As you can see there is an extra step and its not as exlicit to the source provided and there is an extra step and extra knowledge, which is important as we want to keep halucinations to a minimum.