mirror of
https://github.com/QwenLM/Qwen.git
synced 2026-05-20 16:35:47 +08:00
add modelscope links for int8 models
This commit is contained in:
18
README_JA.md
18
README_JA.md
@@ -22,8 +22,8 @@
|
||||
|
||||
| | Qwen-Chat | Qwen-Chat (Int4) | Qwen-Chat (Int8) | Qwen |
|
||||
|-----|:------------------------------------------------------------------------------------------------------------------------------------:|:----------------------------------------------------------------------------------------------------------------------------------------------:|:---------------------------------------------------------------:|:--------------------------------------------------------------------------------------------------------------------------:|
|
||||
| 7B | <a href="https://modelscope.cn/models/qwen/Qwen-7B-Chat/summary">๐ค</a> <a href="https://huggingface.co/Qwen/Qwen-7B-Chat">๐ค</a> | <a href="https://modelscope.cn/models/qwen/Qwen-7B-Chat-Int4/summary">๐ค</a> <a href="https://huggingface.co/Qwen/Qwen-7B-Chat-Int4">๐ค</a> | <a href="https://huggingface.co/Qwen/Qwen-7B-Chat-Int8">๐ค</a> | <a href="https://modelscope.cn/models/qwen/Qwen-7B/summary">๐ค</a> <a href="https://huggingface.co/Qwen/Qwen-7B">๐ค</a> |
|
||||
| 14B | <a href="https://modelscope.cn/models/qwen/Qwen-14B-Chat/summary">๐ค</a> <a href="https://huggingface.co/Qwen/Qwen-14B-Chat">๐ค</a> | <a href="https://modelscope.cn/models/qwen/Qwen-14B-Chat-Int4/summary">๐ค</a> <a href="https://huggingface.co/Qwen/Qwen-14B-Chat-Int4">๐ค</a> | <a href="https://huggingface.co/Qwen/Qwen-14B-Chat-Int8">๐ค</a> | <a href="https://modelscope.cn/models/qwen/Qwen-14B/summary">๐ค</a> <a href="https://huggingface.co/Qwen/Qwen-14B">๐ค</a> |
|
||||
| 7B | <a href="https://modelscope.cn/models/qwen/Qwen-7B-Chat/summary">๐ค</a> <a href="https://huggingface.co/Qwen/Qwen-7B-Chat">๐ค</a> | <a href="https://modelscope.cn/models/qwen/Qwen-7B-Chat-Int4/summary">๐ค</a> <a href="https://huggingface.co/Qwen/Qwen-7B-Chat-Int4">๐ค</a> | <a href="https://modelscope.cn/models/qwen/Qwen-7B-Chat-Int8/summary">๐ค</a> <a href="https://huggingface.co/Qwen/Qwen-7B-Chat-Int8">๐ค</a> | <a href="https://modelscope.cn/models/qwen/Qwen-7B/summary">๐ค</a> <a href="https://huggingface.co/Qwen/Qwen-7B">๐ค</a> |
|
||||
| 14B | <a href="https://modelscope.cn/models/qwen/Qwen-14B-Chat/summary">๐ค</a> <a href="https://huggingface.co/Qwen/Qwen-14B-Chat">๐ค</a> | <a href="https://modelscope.cn/models/qwen/Qwen-14B-Chat-Int4/summary">๐ค</a> <a href="https://huggingface.co/Qwen/Qwen-14B-Chat-Int4">๐ค</a> | <a href="https://modelscope.cn/models/qwen/Qwen-14B-Chat-Int8/summary">๐ค</a> <a href="https://huggingface.co/Qwen/Qwen-14B-Chat-Int8">๐ค</a> | <a href="https://modelscope.cn/models/qwen/Qwen-14B/summary">๐ค</a> <a href="https://huggingface.co/Qwen/Qwen-14B">๐ค</a> |
|
||||
|
||||
|
||||
|
||||
@@ -200,10 +200,10 @@ from modelscope import snapshot_download
|
||||
from transformers import AutoModelForCausalLM, AutoTokenizer
|
||||
|
||||
# Downloading model checkpoint to a local dir model_dir
|
||||
# model_dir = snapshot_download('qwen/Qwen-7B', revision='v1.1.4')
|
||||
# model_dir = snapshot_download('qwen/Qwen-7B-Chat', revision='v1.1.4')
|
||||
# model_dir = snapshot_download('qwen/Qwen-14B', revision='v1.0.4')
|
||||
model_dir = snapshot_download('qwen/Qwen-14B-Chat', revision='v1.0.4')
|
||||
# model_dir = snapshot_download('qwen/Qwen-7B')
|
||||
# model_dir = snapshot_download('qwen/Qwen-7B-Chat')
|
||||
# model_dir = snapshot_download('qwen/Qwen-14B')
|
||||
model_dir = snapshot_download('qwen/Qwen-14B-Chat')
|
||||
|
||||
# Loading local checkpoints
|
||||
# trust_remote_code is still set as True since we still load codes from local dir instead of transformers
|
||||
@@ -224,9 +224,9 @@ from modelscope import AutoModelForCausalLM, AutoTokenizer
|
||||
from modelscope import GenerationConfig
|
||||
|
||||
# Model names๏ผ"Qwen/Qwen-7B-Chat"ใ"Qwen/Qwen-14B-Chat"
|
||||
tokenizer = AutoTokenizer.from_pretrained("qwen/Qwen-7B-Chat", revision='v1.0.5', trust_remote_code=True)
|
||||
model = AutoModelForCausalLM.from_pretrained("qwen/Qwen-7B-Chat", revision='v1.0.5', device_map="auto", trust_remote_code=True, fp16=True).eval()
|
||||
model.generation_config = GenerationConfig.from_pretrained("Qwen/Qwen-7B-Chat", revision='v1.0.5', trust_remote_code=True) # ๅฏๆๅฎไธๅ็็ๆ้ฟๅบฆใtop_p็ญ็ธๅ
ณ่ถ
ๅ
|
||||
tokenizer = AutoTokenizer.from_pretrained("qwen/Qwen-7B-Chat", trust_remote_code=True)
|
||||
model = AutoModelForCausalLM.from_pretrained("qwen/Qwen-7B-Chat", device_map="auto", trust_remote_code=True, fp16=True).eval()
|
||||
model.generation_config = GenerationConfig.from_pretrained("Qwen/Qwen-7B-Chat", trust_remote_code=True) # ๅฏๆๅฎไธๅ็็ๆ้ฟๅบฆใtop_p็ญ็ธๅ
ณ่ถ
ๅ
|
||||
|
||||
response, history = model.chat(tokenizer, "ไฝ ๅฅฝ", history=None)
|
||||
print(response)
|
||||
|
||||
Reference in New Issue
Block a user