Update README.md
Browse files
README.md
CHANGED
|
@@ -21,13 +21,26 @@ It has been trained using [TRL](https://github.com/huggingface/trl).
|
|
| 21 |
|
| 22 |
## Quick start
|
| 23 |
|
|
|
|
|
|
|
|
|
|
| 24 |
```python
|
| 25 |
from transformers import pipeline
|
| 26 |
|
| 27 |
-
question = "
|
| 28 |
-
generator = pipeline("text-generation", model="roberthsu2003/llama3.2_3B_Instruct",
|
| 29 |
output = generator([{"role": "user", "content": question}], max_new_tokens=128, return_full_text=False)[0]
|
| 30 |
print(output["generated_text"])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
```
|
| 32 |
|
| 33 |
## Training procedure
|
|
|
|
| 21 |
|
| 22 |
## Quick start
|
| 23 |
|
| 24 |
+
- 注意沒辦法在mac silicon上執行
|
| 25 |
+
- 要開啟cuda的GPU
|
| 26 |
+
|
| 27 |
```python
|
| 28 |
from transformers import pipeline
|
| 29 |
|
| 30 |
+
question = "請問光的3原色?"
|
| 31 |
+
generator = pipeline("text-generation", model="roberthsu2003/llama3.2_3B_Instruct",device_map="auto", trust_remote_code=True)
|
| 32 |
output = generator([{"role": "user", "content": question}], max_new_tokens=128, return_full_text=False)[0]
|
| 33 |
print(output["generated_text"])
|
| 34 |
+
|
| 35 |
+
#======output==========
|
| 36 |
+
光的三原色是紅、藍和綠色。
|
| 37 |
+
|
| 38 |
+
|
| 39 |
+
output = generator([{"role": "user", "content": "請介紹一下台灣這個國家"}], max_new_tokens=128, return_full_text=False)[0]
|
| 40 |
+
print(output["generated_text"])
|
| 41 |
+
|
| 42 |
+
#==========output==========
|
| 43 |
+
台灣是位於東亞的島國,擁有人口超過3.5億。它是一個繁榮的經濟體系,擁有世界上最好的科技、教育和醫療系統。台灣是世界上最多種語言的國家,主要語言包括繁體中文、台語、 Hoklo、 Hakka 和 Min Nan。它是世界上最多種宗教的國家,主要宗教包括佛教、天主教、基督教、伊斯蘭教和無神論
|
| 44 |
```
|
| 45 |
|
| 46 |
## Training procedure
|