Update README.md
This commit is contained in:
135
README.md
135
README.md
@@ -1,47 +1,100 @@
|
||||
---
|
||||
license: Apache License 2.0
|
||||
|
||||
#model-type:
|
||||
##如 gpt、phi、llama、chatglm、baichuan 等
|
||||
#- gpt
|
||||
|
||||
#domain:
|
||||
##如 nlp、cv、audio、multi-modal
|
||||
#- nlp
|
||||
|
||||
#language:
|
||||
##语言代码列表 https://help.aliyun.com/document_detail/215387.html?spm=a2c4g.11186623.0.0.9f8d7467kni6Aa
|
||||
#- cn
|
||||
|
||||
#metrics:
|
||||
##如 CIDEr、Blue、ROUGE 等
|
||||
#- CIDEr
|
||||
|
||||
#tags:
|
||||
##各种自定义,包括 pretrained、fine-tuned、instruction-tuned、RL-tuned 等训练方法和其他
|
||||
#- pretrained
|
||||
|
||||
#tools:
|
||||
##如 vllm、fastchat、llamacpp、AdaSeq 等
|
||||
#- vllm
|
||||
datasets:
|
||||
- allenai/WildChat-1M
|
||||
- allenai/WildChat-1M-Full
|
||||
- allenai/WildChat
|
||||
extra_gated_prompt: >-
|
||||
Access to this model is automatically granted upon accepting the [**AI2
|
||||
ImpACT License - Medium Risk Artifacts (“MR
|
||||
Agreement”)**](https://allenai.org/licenses/impact-mr) and completing all
|
||||
fields below.
|
||||
extra_gated_fields:
|
||||
Your full name: text
|
||||
Organization or entity you are affiliated with: text
|
||||
State or country you are located in: text
|
||||
Contact email: text
|
||||
Please describe your intended use of the medium risk artifact(s): text
|
||||
I UNDERSTAND that the model is intended for research purposes and not for real-world use-cases: checkbox
|
||||
I AGREE to the terms and conditions of the MR Agreement above: checkbox
|
||||
I AGREE to AI2’s use of my information for legal notices and administrative matters: checkbox
|
||||
I CERTIFY that the information I have provided is true and accurate: checkbox
|
||||
---
|
||||
### 当前模型的贡献者未提供更加详细的模型介绍。模型文件和权重,可浏览“模型文件”页面获取。
|
||||
#### 您可以通过如下git clone命令,或者ModelScope SDK来下载模型
|
||||
|
||||
SDK下载
|
||||
```bash
|
||||
#安装ModelScope
|
||||
pip install modelscope
|
||||
|
||||
# Model Card for WildLlama-7b-assistant-only
|
||||
|
||||
## Model Description
|
||||
|
||||
The WildLlama-7b-assistant-only model is a chatbot derived from the [Llama-2 model by Meta](https://huggingface.co/meta-llama/Llama-2-7b-hf) that is licensed under the [Llama 2 License](https://ai.meta.com/resources/models-and-libraries/llama-downloads/), enhanced through fine-tuning on the [WildChat Dataset](https://huggingface.co/datasets/allenai/WildChat)'s user-ChatGPT interactions. WildLlama-7b-assistant-only is trained to predict **only assistant responses**. To be able to both predict user prompts and assistant responses, check out [WildLlama-7b-user-assistant](https://huggingface.co/allenai/WildLlama-7b-user-assistant).
|
||||
|
||||
- **Model type:** Language model
|
||||
- **Language(s) (NLP):** multi-lingual
|
||||
- **License:** [**AI2
|
||||
ImpACT License - Medium Risk Artifacts ("MR
|
||||
Agreement")**](https://allenai.org/licenses/impact-mr)
|
||||
- **Parent Model:** https://huggingface.co/meta-llama/Llama-2-7b-hf
|
||||
- **Paper:** https://arxiv.org/abs/2405.01470
|
||||
- **Visualization Tool:** https://wildvisualizer.com
|
||||
- **Visualization Paper:** https://arxiv.org/abs/2409.03753
|
||||
|
||||
|
||||
# Bias, Risks, and Limitations
|
||||
|
||||
Significant research has explored bias and fairness issues with language models (see, e.g., [Sheng et al. (2021)](https://aclanthology.org/2021.acl-long.330.pdf) and [Bender et al. (2021)](https://dl.acm.org/doi/pdf/10.1145/3442188.3445922)). Predictions generated by the model may include disturbing and harmful stereotypes across protected classes; identity characteristics; and sensitive, social, and occupational groups.
|
||||
|
||||
## Recommendations
|
||||
|
||||
We recommend that this model not be used for any high-impact or human-facing purposes as its biases and limitations need to be further explored.
|
||||
We intend this to be a research artifact to advance AI's ability to better serve human needs.
|
||||
|
||||
# Citation
|
||||
|
||||
**BibTeX:**
|
||||
|
||||
```
|
||||
@inproceedings{
|
||||
zhao2024wildchat,
|
||||
title={WildChat: 1M Chat{GPT} Interaction Logs in the Wild},
|
||||
author={Wenting Zhao and Xiang Ren and Jack Hessel and Claire Cardie and Yejin Choi and Yuntian Deng},
|
||||
booktitle={The Twelfth International Conference on Learning Representations},
|
||||
year={2024},
|
||||
url={https://openreview.net/forum?id=Bl8u7ZRlbM}
|
||||
}
|
||||
```
|
||||
|
||||
```
|
||||
@misc{deng2024wildvisopensourcevisualizer,
|
||||
title={WildVis: Open Source Visualizer for Million-Scale Chat Logs in the Wild},
|
||||
author={Yuntian Deng and Wenting Zhao and Jack Hessel and Xiang Ren and Claire Cardie and Yejin Choi},
|
||||
year={2024},
|
||||
eprint={2409.03753},
|
||||
archivePrefix={arXiv},
|
||||
primaryClass={cs.CL},
|
||||
url={https://arxiv.org/abs/2409.03753},
|
||||
}
|
||||
```
|
||||
|
||||
# How to Get Started with the Model
|
||||
|
||||
Use the code below to get started with the model.
|
||||
```python
|
||||
#SDK模型下载
|
||||
from modelscope import snapshot_download
|
||||
model_dir = snapshot_download('allenai/WildLlama-7b-assistant-only')
|
||||
```
|
||||
Git下载
|
||||
```
|
||||
#Git模型下载
|
||||
git clone https://www.modelscope.cn/allenai/WildLlama-7b-assistant-only.git
|
||||
```
|
||||
import torch
|
||||
from transformers import AutoTokenizer, AutoModelForCausalLM
|
||||
|
||||
<p style="color: lightgrey;">如果您是本模型的贡献者,我们邀请您根据<a href="https://modelscope.cn/docs/ModelScope%E6%A8%A1%E5%9E%8B%E6%8E%A5%E5%85%A5%E6%B5%81%E7%A8%8B%E6%A6%82%E8%A7%88" style="color: lightgrey; text-decoration: underline;">模型贡献文档</a>,及时完善模型卡片内容。</p>
|
||||
device = "cuda" if torch.cuda.is_available() else "cpu"
|
||||
|
||||
model_name = 'allenai/WildLlama-7b-assistant-only'
|
||||
tokenizer = AutoTokenizer.from_pretrained(model_name)
|
||||
model = AutoModelForCausalLM.from_pretrained(model_name).to(device)
|
||||
|
||||
# Notice the </s>! Note that the format is slightly different from allenai/WildLlama-7b-user-assistant
|
||||
# Format: A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions. USER: abc ASSISTANT: def</s>USER: def ASSISTANT: adfs</s>USER: asdf
|
||||
# To generate an assistant response
|
||||
user_prompt = 'Write a story about a dinosaur on an airplane.'
|
||||
prompt = f"A chat between a curious user and an artificial intelligence assistant. The assistant gives helpful, detailed, and polite answers to the user's questions. USER: {user_prompt} ASSISTANT:"
|
||||
model_inputs = tokenizer(prompt, return_tensors='pt', add_special_tokens=False).to(device)
|
||||
output = model.generate(**model_inputs)
|
||||
|
||||
print("Output:\n" + 100 * '-')
|
||||
print(tokenizer.decode(output[0], skip_special_tokens=True))
|
||||
```
|
||||
Reference in New Issue
Block a user