Update README.md

This commit is contained in:
Cherrytest
2023-10-21 00:22:08 +00:00
parent f9199225e8
commit b94edc955e

View File

@@ -21,13 +21,38 @@ The models follow the conversation format of [Llama-2-chat](https://huggingface.
You are a helpful, respectful and honest assistant. You are a helpful, respectful and honest assistant.
``` ```
7B, 13B, and 70B models are available on Huggingface model hub.
|Model|Huggingface Repo| ### How to use in modelscope
```python
import torch
from modelscope import Model, AutoTokenizer
model = Model.from_pretrained("ZhipuAI/agentlm-7b", revision='master', device_map='auto', torch_dtype=torch.float16)
tokenizer = AutoTokenizer.from_pretrained("ZhipuAI/agentlm-7b", revision='master')
prompt = """<s>[INST] <<SYS>>
<s>[INST] <<SYS>>
You are a helpful, respectful and honest assistant.
<</SYS>>
There's a llama in my garden 😱 What should I do? [/INST]"""
inputs = tokenizer(prompt, return_tensors="pt")
# Generate
generate_ids = model.generate(inputs.input_ids.to(model.device), max_length=30)
print(tokenizer.batch_decode(generate_ids, skip_special_tokens=True, clean_up_tokenization_spaces=False)[0])
```
7B, 13B, and 70B models are available on ModelScope model hub.
|Model|ModelScope Repo|
|---|---| |---|---|
|AgentLM-7B| [🤗Huggingface Repo](https://huggingface.co/THUDM/agentlm-7b) | |AgentLM-7B| [ModelScope Repo](https://modelscope.cn/models/ZhipuAI/agentlm-7b) |
|AgentLM-13B| [🤗Huggingface Repo](https://huggingface.co/THUDM/agentlm-13b) | |AgentLM-13B| [ModelScope Repo](https://modelscope.cn/models/ZhipuAI/agentlm-13b) |
|AgentLM-70B| [🤗Huggingface Repo](https://huggingface.co/THUDM/agentlm-70b) | |AgentLM-70B| [ModelScope Repo](https://modelscope.cn/models/ZhipuAI/agentlm-70b) |
## Citation ## Citation