Text Generation
PEFT
Safetensors
dfurman commited on
Commit
791a4c8
•
1 Parent(s): 2341ebe

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +26 -18
README.md CHANGED
@@ -3,8 +3,6 @@ datasets:
3
  - OpenAssistant/oasst1
4
  pipeline_tag: text-generation
5
  license: tii-falcon-llm
6
- language:
7
- - en
8
  ---
9
 
10
  # 🚀 Falcon-7b-chat-oasst1
@@ -60,23 +58,24 @@ Daniel
60
 
61
  **Prompter**:
62
  ```
63
- <human>: Create a list of four things to do in San Francisco.
64
  <bot>:
65
  ```
66
 
67
  **Falcon-7b-chat-oasst1**:
68
  ```
69
- Here are four things to do in San Francisco:
70
-
71
- 1. Visit the Golden Gate Bridge: The Golden Gate Bridge is one of the most iconic landmarks in the world and is a must-see for any visitor to San Francisco. The bridge offers stunning views of the city and the Pacific Ocean, and there are plenty of opportunities for photos and sightseeing along the way.
72
-
73
- 2. Explore Chinatown: San Francisco's Chinatown is one of the oldest and most vibrant Chinatowns in the world, and it's a great place to explore the city's Chinese culture and history. You can wander the streets, sample the local cuisine, and visit the many shops and markets.
74
-
75
- 3. Visit Alcatraz Island: Alcatraz Island is a former prison and military fort located in the middle of San Francisco Bay. The island is now a popular tourist attraction and offers guided tours that take visitors through the prison cells and other historic buildings.
76
-
77
- 4. Take a cable car ride: San Francisco's cable cars are a classic tourist attraction and offer a unique way to explore the city. The cars run along several routes and offer stunning views of the city and the surrounding area.
78
-
79
- These are just a few of the many things to do in San Francisco. There are plenty of other activities, sights, and attractions to explore, so be sure to do your research and plan your trip accordingly.
 
80
  ```
81
 
82
  ### Direct Use
@@ -110,6 +109,8 @@ We recommend users of this model to develop guardrails and to take appropriate p
110
 
111
  This requires a GPU with at least 12 GB of memory.
112
 
 
 
113
  ```python
114
  import torch
115
  from peft import PeftModel, PeftConfig
@@ -131,8 +132,11 @@ tokenizer = AutoTokenizer.from_pretrained(config.base_model_name_or_path)
131
  tokenizer.pad_token = tokenizer.eos_token
132
 
133
  model = PeftModel.from_pretrained(model, peft_model_id)
 
134
 
135
- # run the model
 
 
136
  prompt = """<human>: My name is Daniel. Write a short email to my closest friends inviting them to come to my home on Friday for a dinner party, I will make the food but tell them to BYOB.
137
  <bot>:"""
138
 
@@ -146,13 +150,17 @@ batch = batch.to('cuda:0')
146
 
147
  with torch.cuda.amp.autocast():
148
  output_tokens = model.generate(
149
- input_ids = batch.input_ids,
150
  max_new_tokens=200,
151
- temperature=0.7,
152
- top_p=0.7,
 
 
 
153
  num_return_sequences=1,
154
  pad_token_id=tokenizer.eos_token_id,
155
  eos_token_id=tokenizer.eos_token_id,
 
156
  )
157
 
158
  generated_text = tokenizer.decode(output_tokens[0], skip_special_tokens=True)
 
3
  - OpenAssistant/oasst1
4
  pipeline_tag: text-generation
5
  license: tii-falcon-llm
 
 
6
  ---
7
 
8
  # 🚀 Falcon-7b-chat-oasst1
 
58
 
59
  **Prompter**:
60
  ```
61
+ <human>: Create a list of things to do in San Francisco.
62
  <bot>:
63
  ```
64
 
65
  **Falcon-7b-chat-oasst1**:
66
  ```
67
+ Here are some things to do in San Francisco:
68
+
69
+ 1. Visit the Golden Gate Bridge
70
+ 2. Explore the city's many museums and art galleries
71
+ 3. Take a walk along the Embarcadero waterfront
72
+ 4. Enjoy the views from the top of Coit Tower
73
+ 5. Shop at Union Square and the Ferry Building
74
+ 6. Eat at one of the city's many restaurants and cafes
75
+ 7. Attend a sporting event at AT&T Park
76
+ 8. Visit the Castro District and the Mission District
77
+ 9. Take a day trip to Napa Valley or Muir Woods National Monument
78
+ 10. Explore the city's many parks and gardens
79
  ```
80
 
81
  ### Direct Use
 
109
 
110
  This requires a GPU with at least 12 GB of memory.
111
 
112
+ ### First, Load the Model
113
+
114
  ```python
115
  import torch
116
  from peft import PeftModel, PeftConfig
 
132
  tokenizer.pad_token = tokenizer.eos_token
133
 
134
  model = PeftModel.from_pretrained(model, peft_model_id)
135
+ ```
136
 
137
+ ### Next, Run the Model
138
+
139
+ ```python
140
  prompt = """<human>: My name is Daniel. Write a short email to my closest friends inviting them to come to my home on Friday for a dinner party, I will make the food but tell them to BYOB.
141
  <bot>:"""
142
 
 
150
 
151
  with torch.cuda.amp.autocast():
152
  output_tokens = model.generate(
153
+ inputs=batch.input_ids,
154
  max_new_tokens=200,
155
+ do_sample=False,
156
+ use_cache=True,
157
+ temperature=1.0,
158
+ top_k=50,
159
+ top_p=1.0,
160
  num_return_sequences=1,
161
  pad_token_id=tokenizer.eos_token_id,
162
  eos_token_id=tokenizer.eos_token_id,
163
+ bos_token_id=tokenizer.eos_token_id,
164
  )
165
 
166
  generated_text = tokenizer.decode(output_tokens[0], skip_special_tokens=True)