cloudyu commited on
Commit
c4b8a5a
1 Parent(s): 25d956c

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +3 -3
README.md CHANGED
@@ -2,7 +2,7 @@
2
  license: apache-2.0
3
  ---
4
 
5
- code example
6
 
7
  ```
8
  import transformers
@@ -14,13 +14,13 @@ pipeline = transformers.pipeline(
14
  "text-generation",
15
  model=model_id,
16
  model_kwargs={"torch_dtype": torch.float16},
17
- device_map="auto",
18
  )
19
 
20
  prompt = "what is biggest animal in earth?"
21
  while len(prompt)>0:
22
  messages = [
23
- {"role": "system", "content": "You are a pirate chatbot who always responds in pirate speak!"},
24
  {"role": "user", "content": prompt},
25
  ]
26
 
 
2
  license: apache-2.0
3
  ---
4
 
5
+ Apple MPS code example
6
 
7
  ```
8
  import transformers
 
14
  "text-generation",
15
  model=model_id,
16
  model_kwargs={"torch_dtype": torch.float16},
17
+ device_map="mps",
18
  )
19
 
20
  prompt = "what is biggest animal in earth?"
21
  while len(prompt)>0:
22
  messages = [
23
+ {"role": "system", "content": "You are a nice chatbot who always responds in kindly speak!"},
24
  {"role": "user", "content": prompt},
25
  ]
26