Update README.md
Browse files
README.md
CHANGED
@@ -166,5 +166,17 @@ pipeline = transformers.pipeline(
|
|
166 |
tokenizer=tokenizer,
|
167 |
torch_dtype=torch.bfloat16,
|
168 |
trust_remote_code=True,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
169 |
```
|
170 |
|
|
|
166 |
tokenizer=tokenizer,
|
167 |
torch_dtype=torch.bfloat16,
|
168 |
trust_remote_code=True,
|
169 |
+
device_map="auto",
|
170 |
+
)
|
171 |
+
sequences = pipeline(
|
172 |
+
"If a public stock price has been rising for years, what is most likely to happen in the next year?",
|
173 |
+
max_length=200,
|
174 |
+
do_sample=True,
|
175 |
+
top_k=10,
|
176 |
+
num_return_sequences=1,
|
177 |
+
eos_token_id=tokenizer.eos_token_id,
|
178 |
+
)
|
179 |
+
for seq in sequences:
|
180 |
+
print(f"Result: {seq['generated_text']}")
|
181 |
```
|
182 |
|