update LICENSE

Link: https://code.alibaba-inc.com/Ali-MaaS/MaaS-lib/codereview/13516119
This commit is contained in:
lukeming.lkm
2023-08-03 11:07:34 +08:00
committed by wenmeng.zwm
parent 16e0dbef2a
commit 1366ca97df
4 changed files with 43 additions and 23 deletions

View File

@@ -1,22 +1,21 @@
Tongyi QWen LICENSE AGREEMENT
Tongyi Qianwen LICENSE AGREEMENT
Tongyi QWen Release Date: August 3, 2023
Tongyi Qianwen Release Date: August 3, 2023
By clicking to agree or by using or distributing any portion or element of the Tongyi QWen Materials, you will be deemed to have accepted and recognized the content of this Agreement, which is effective immediately.
By clicking to agree or by using or distributing any portion or element of the Tongyi Qianwen Materials, you will be deemed to have recognized and accepted the content of this Agreement, which is effective immediately.
1. Definitions
a. This Tongyi QWen LICENSE AGREEMENT (this "Agreement") shall mean the terms and conditions for use, reproduction, distribution and modification of the Materials as defined by this Agreement.
a. This Tongyi Qianwen LICENSE AGREEMENT (this "Agreement") shall mean the terms and conditions for use, reproduction, distribution and modification of the Materials as defined by this Agreement.
b. "We"(or "Us") shall mean the operation entity of Alibaba Cloud and its affiliates.
c. "You" (or "Your") shall mean a natural person or legal entity exercising the rights granted by this Agreement and/or using the Materials for any purpose and in any field of use.
d. "Third Parties" shall mean individuals or legal entities that are not under common control with Us or You.
e. "Tongyi QWen" shall mean the large language models and software and
e. "Tongyi Qianwen" shall mean the large language models (including Qwen-7b model and Qwen-7b-Chat model ), and software and
algorithms, consisting of trained model weights, parameters (including optimizer states), machine-learning model code, inference-enabling code, training-enabling code, fine-tuning enabling code and other elements of the foregoing distributed by Us.
f. "Materials" shall mean, collectively, Alibaba Cloud's proprietary Tongyi QWen and Documentation (and any portion thereof) made available under this Agreement.
g. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
f. "Materials" shall mean, collectively, Alibaba Cloud's proprietary Tongyi Qianwen and Documentation (and any portion thereof) made available under this Agreement.
g. "Source" form shall mean the preferred form for making modifications, including but not limited to model source code, documentation source, and configuration files.
h. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation,
and conversions to other media types.
2. Grant of Rights
You are granted a non-exclusive, worldwide, non-transferable and royalty-free limited license under Alibaba Cloud's intellectual property or other rights owned by Us embodied in the Materials to use, reproduce, distribute, copy, create derivative works of, and make modifications to the Materials.
@@ -24,7 +23,7 @@ You are granted a non-exclusive, worldwide, non-transferable and royalty-free li
You may reproduce and distribute copies of the Materials or derivative works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
a. You shall give any other recipients of the Materials or derivative works a copy of this Agreement;
b. You shall cause any modified files to carry prominent notices stating that You changed the files;
c. You shall retain in all copies of the Materials that You distribute the following attribution notices within a "Notice" text file distributed as a part of such copies:"Tongyi QWen is licensed under the Tongyi QWen LICENSE AGREEMENT, Copyright (c) Alibaba Could. All Rights Reserved."; and
c. You shall retain in all copies of the Materials that You distribute the following attribution notices within a "Notice" text file distributed as a part of such copies:"Tongyi Qianwen is licensed under the Tongyi Qianwen LICENSE AGREEMENT, Copyright (c) Alibaba Could. All Rights Reserved."; and
d. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such derivative works as a whole, provided Your use, reproduction, and distribution of the work otherwise complies with the terms and conditions of this Agreement.
4. Restrictions
@@ -32,18 +31,17 @@ If you are commercially using the Materials, and your product or service has mor
5. Rules of use
a. The Materials may be subject to export controls or restrictions in China, the United States or other countries or regions. You shall comply with applicable laws and regulations in your use of the Materials.
b. You can not use the Materials or any output therefrom to improve any other large language model (excluding Tongyi QWen or derivative works thereof).
b. You can not use the Materials or any output therefrom to improve any other large language model (excluding Tongyi Qianwen or derivative works thereof).
6. Intellectual Property
a. We retain ownership of all intellectual property rights in and to the Materials and derivatives made by or for Us. Conditioned upon compliance with the terms and conditions of this Agreement, with respect to any derivative works and modifications of the Materials that are made by you, you are and will be the owner of such derivative works and modifications.
b. No trademark license is granted to use the trade names, trademarks, service marks, or product names of Us, except as required to fulfill notice requirements under this Agreement or as required for reasonable and customary use in describing and redistributing the Materials.
c. If you commence a lawsuit or other proceedings (including a cross-claim or counterclaim in a lawsuit) against Us or any entity alleging that the Materials or any output therefrom, or any part of the foregoing, infringe any intellectual property or other right owned or licensable by you, then all licences granted to you under this Agreement shall terminate as of the date such lawsuit or other proceeding is commenced or brought.
7. Disclaimer of Warranty and Limitation of Liability
a. We are not obligated to support, update, provide training for, or develop any further version of the Tongyi Ok iQWen Model or to grant any license thereto.
b. THE MATERIALS ARE PROVIDED "AS IS" WITHOUT ANY EXPRESS OR IMPLIED WARRANTY OF ANY KIND INCLUDING WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, OR FITNESS FOR A PARTICULAR PURPOSE. WE MAKE NOT WARRANTY AND ASSUME NO RESPONSIBILITY FOR THE SAFETY OR STABILITY OF THE MATERIALS AND ANY OUTPUT THEREFROM.
a. We are not obligated to support, update, provide training for, or develop any further version of the Tongyi Qianwen Model or to grant any license thereto.
b. THE MATERIALS ARE PROVIDED "AS IS" WITHOUT ANY EXPRESS OR IMPLIED WARRANTY OF ANY KIND INCLUDING WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT, OR FITNESS FOR A PARTICULAR PURPOSE. WE MAKE NO WARRANTY AND ASSUME NO RESPONSIBILITY FOR THE SAFETY OR STABILITY OF THE MATERIALS AND ANY OUTPUT THEREFROM.
c. IN NO EVENT SHALL WE BE LIABLE TO YOU FOR ANY DAMAGES, INCLUDING, BUT NOT LIMITED TO ANY DIRECT, OR INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM YOUR USE OR INABILITY TO USE THE MATERIALS OR ANY OUTPUT OF IT, NO MATTER HOW ITS CAUSED.
d. You will indemnify and hold armless Us from and against any claim by any third party arising out of or related to your use or distribution of the Materials.
@@ -51,7 +49,35 @@ If you are commercially using the Materials, and your product or service has mor
a. The term of this Agreement shall commence upon your acceptance of this Agreement or access to the Materials and will continue in full force and effect until terminated in accordance with the terms and conditions herein.
b. We may terminate this Agreement if you breach any of the terms or conditions of this Agreement. Upon termination of this Agreement, you must delete and cease use of the Materials. Sections 7 and 9 shall survive the termination of this Agreement.
9. Governing Law and Jurisdiction.
a. This Agreement and any dispute arising out of or relating to it will be governed by the laws of China, without regard to conflict of law principles, and the UN Convention on Contracts for the International Sale of Goods does not apply to this Agreement.
b. The People's Court in Hangzhou City shall have exclusive jurisdiction over any dispute arising out of this Agreement.
b. The People's Courts in Hangzhou City shall have exclusive jurisdiction over any dispute arising out of this Agreement.
------------- LICENSE FOR NVIDIA Megatron-LM code --------------
Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of NVIDIA CORPORATION nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@@ -165,7 +165,7 @@ class QWenForTextGeneration(QWenPreTrainedModel):
tokenizer: PreTrainedTokenizer,
query: str,
history: Optional[HistoryType],
system: str = '',
system: str = 'You are a helpful assistant.',
append_history: bool = True,
) -> Tuple[str, HistoryType]:

View File

@@ -330,7 +330,7 @@ class QWenChatPipeline(Pipeline):
# define the forward pass
def forward(self, inputs: str, **forward_params) -> Dict[str, Any]:
history = forward_params.get('history', None)
system = forward_params.get('system', '')
system = forward_params.get('system', 'You are a helpful assistant.')
append_history = forward_params.get('append_history', True)
return self.model.chat(self.tokenizer, inputs, history, system,
append_history)

View File

@@ -17,7 +17,6 @@ class QWenTextGenerationPipelineTest(unittest.TestCase):
self.qwen_chat = '../qwen_7b_ckpt_chat_modelscope/' # local test only
self.qwen_base_input = '蒙古国的首都是乌兰巴托Ulaanbaatar\n冰岛的首都是雷克雅未克Reykjavik\n埃塞俄比亚的首都是'
self.qwen_chat_system = 'You are a helpful assistant.'
self.qwen_chat_input = [
'今天天气真好,我', 'How do you do? ', "What's your", '今夜阳光明媚', '宫廷玉液酒,',
'7 * 8 + 32 =? ', '请问把大象关冰箱总共要几步?', '1+3=?',
@@ -38,7 +37,6 @@ class QWenTextGenerationPipelineTest(unittest.TestCase):
def run_chat_pipeline_with_model_id(self,
model_id,
inputs,
system,
init_kwargs={},
run_kwargs={}):
pipeline_ins = pipeline(task=Tasks.chat, model=model_id, **init_kwargs)
@@ -49,7 +47,6 @@ class QWenTextGenerationPipelineTest(unittest.TestCase):
results = pipeline_ins(
query,
history=history,
system=system,
)
response, history = results['response'], results['history']
print(f'===== Turn {turn_idx} ====')
@@ -103,7 +100,6 @@ class QWenTextGenerationPipelineTest(unittest.TestCase):
self.run_chat_pipeline_with_model_id(
self.qwen_chat,
self.qwen_chat_input,
self.qwen_chat_system,
init_kwargs={
'device_map': 'auto',
})
@@ -116,7 +112,6 @@ class QWenTextGenerationPipelineTest(unittest.TestCase):
self.run_chat_pipeline_with_model_id(
self.qwen_chat,
self.qwen_chat_input,
self.qwen_chat_system,
init_kwargs={
'device_map': 'auto',
'use_max_memory': True,
@@ -134,7 +129,6 @@ class QWenTextGenerationPipelineTest(unittest.TestCase):
self.run_chat_pipeline_with_model_id(
self.qwen_chat,
self.qwen_chat_input,
self.qwen_chat_system,
init_kwargs={
'device_map': 'auto',
'use_max_memory': True,