import streamlit as st import base64 PDF_WIDTH = 700 PDF_HEIGHT = 1000 def display_pdf(file): # Opening file from file path with open(file, "rb") as f: base64_pdf = base64.b64encode(f.read()).decode('utf-8') # Embedding PDF in HTML pdf_display = F'' # Displaying File st.markdown(pdf_display, unsafe_allow_html=True) st.markdown("# BigCode Open RAIL-M v1 License Agreement") st.markdown(" ## Section I: Preamble") st.markdown("This OpenRAIL-M License Agreement was created under BigCode, an open and collaborative research project aimed at the responsible development and Use of Large Language Models (“LLMs”) for code generation. This license is generally applicable to any machine-learning Model.") st.markdown("This License Agreement strives for both the open and responsible Use of the accompanying Model. Openness here is understood as enabling users of the Model on a royalty free basis to Use it, modify it, and even share commercial versions of it. Use restrictions are included to prevent misuse of the Model.") st.markdown("This License Agreement governs the Use of the Model and Modifications of the Model. You and Licensor agree as follows:") st.markdown("**1.Definitions**") st.markdown("a. **“Contribution”** means any work of authorship, including the original version of the Model and any Modifications of the Model that is intentionally submitted to Licensor for inclusion in the Model by the copyright owner or by an individual or entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, “submitted” means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Model, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as “Not a Contribution.”") st.markdown("b. **“Contributor”** means Licensor and any individual or entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Model.") st.markdown("c. **“Data”** means a collection of information extracted from the dataset used with the Model, including to train, pretrain, or otherwise evaluate the Model. The Data is not licensed under this License Agreement.") st.markdown("d. **“Explanatory Documentation”** means model cards, data cards, or any other similar documentation or related information dedicated to inform the public about the characteristics of the model. Explanatory documentation is not licensed under this license.") st.markdown("e. **“Harm”** includes but is not limited to physical, mental, psychological, financial and reputational damage, pain, or loss.") st.markdown("f. **“License Agreement”** means this document.") st.markdown("g. **“Licensor”** means the rights owners or entity authorized by the rights owners that are granting the terms and conditions of this License Agreement.") st.markdown("h. **“Model”** means any accompanying machine-learning based assemblies (including checkpoints), consisting of learnt weights and parameters (including optimizer states), corresponding to the model architecture as embodied in source code. Source code is not licensed under this License Agreement.") st.markdown("i. **“Modifications of the Model”** means all changes to the Model or any other model which is created or initialized by transfer of patterns of the weights, parameters, activations or Output of the Model, to the other model, in order to cause the other model to perform similarly to the Model.") st.markdown("j. **“Output”** means the results of operating the Model.") st.markdown("k. **“Share”** means any transmission, reproduction, publication or other sharing of the Model or Modifications of the Model to a third party, including providing the Model as a hosted service made available by electronic or other remote means, including - but not limited to - API-based or web access.") st.markdown("l. **“Third Parties”** means individuals or legal entities that are not under common control with Licensor or You.") st.markdown("m. **“Use”** includes - but is not limited to - generating any Output, fine tuning, updating, running, training, evaluating and/or reparametrizing the Model.") st.markdown("n. **“You”** (or “Your”) means an individual or Legal Entity exercising permissions granted by this License Agreement and/or making Use of the Model for whichever purpose and in any field of Use.") st.markdown("## Section II: INTELLECTUAL PROPERTY RIGHTS") st.markdown("The Model and Modifications of the Model are subject to additional terms as described in Section III, which shall govern the Use of the Model and Modifications of the Model.") st.markdown("2. **Grant of Copyright license.** Subject to the terms and conditions of this License Agreement and where and as applicable, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, copyright license to reproduce, prepare, publicly display, publicly perform, sublicense under the terms herein, and distribute the Model and Modifications of the Model.") st.markdown("3. **Grant of Patent license.** Subject to the terms and conditions of this License Agreement and where and as applicable, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free patent license to make, have made, Use, offer to sell, sell, import, and otherwise transfer the Model, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Model to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Model or a Contribution incorporated within the Model constitutes direct or contributory patent infringement, then any rights granted to You under this License Agreement for the Model shall terminate as of the date such litigation is filed.") st.markdown("## Section III: CONDITIONS OF USE") st.markdown("**4. Use conditions.** Compliance with the restrictions in Attachment A is a condition to the grants in this License Agreement. If You Use the Model, You agree not to Use it for the specified restricted uses set forth in Attachment A.") st.markdown("**5. Sharing of the Model**") st.markdown("**5.1.** You may Share the Model or Modifications of the Model under any license of your choice that does not contradict the restrictions in Attachment A of this License Agreement and includes:") st.markdown("**a.** Paragraph 4 and the restrictions in Attachment A of this License Agreement, or,") st.markdown("**b.** Use conditions similar to Paragraph 4 that must accomplish the same purpose as the use conditions in Paragraph 4 and a similar set of restrictions to those in Attachment A that must accomplish the same purpose as the restrictions in Attachment A.") st.markdown("**5.2.** When You Share the Model or Modifications of the Model, You agree to:") st.markdown("**a.** Give any recipients a copy of this License Agreement;") st.markdown("**b.** Retain all Explanatory Documentation; and if sharing Modifications of the Model, add Explanatory Documentation of the same or better quality documenting the changes made to create the Modifications of the Model; and") st.markdown("**c.** Retain all copyright, patent, trademark, and attribution notices.") st.markdown("**6. The Output You Generate.** Licensor claims no rights in the Output. You agree not to contravene any provision as stated in the License Agreement with your Use of the Output.") st.markdown("## Section IV: OTHER PROVISIONS") st.markdown("**7. Updates and Runtime Restrictions.** Licensor reserves the right to restrict (remotely or otherwise) usage of the Model in violation of this License Agreement, update the Model through electronic means, or modify the Output of the Model based on updates.") st.markdown("**8. Submission of Contributions.** Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Model by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.") st.markdown("**9. Trademarks and related.** Nothing in this License Agreement permits You to make Use of Licensors’ trademarks, trade names, logos or to otherwise suggest endorsement or misrepresent the relationship between the parties; and any rights not expressly granted herein are reserved by the Licensors.") st.markdown("**10. Disclaimer of Warranty.** Unless required by applicable law or agreed to in writing, Licensor provides the Model (and each Contributor provides its Contributions) on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or sharing the Model and Modifications of the Model, and assume any risks associated with Your exercise of permissions under this License Agreement.") st.markdown("**11. Limitation of Liability.** In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License Agreement or out of the Use or inability to Use the Model (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, model failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.") st.markdown("**12. Accepting Warranty or Additional Liability.** While sharing the Model or Modifications of the Model thereof, You may choose to offer and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License Agreement. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.") st.markdown("**13.** This License Agreement is a license of copyright and patent rights and an agreement in contract between You and the Licensor. If any provision of this License Agreement is held to be invalid, illegal or unenforceable, the remaining provisions shall be unaffected thereby and remain valid as if such provision had not been set forth herein.") st.markdown("END OF TERMS AND CONDITIONS") st.markdown(" ## Attachment A - USE RESTRICTIONS") st.markdown("**You agree not to Use the Model or Modifications of the Model:**") st.markdown("(a) In any way that violates any applicable national, federal, state, local or international law or regulation;") st.markdown("(b) For the purpose of exploiting, Harming or attempting to exploit or harm minors in any way;") st.markdown("(c) To generate and/or disseminate malware (including - but not limited to - ransomware) or any other content to be used for the purpose of Harming electronic systems;") st.markdown("(d) To generate or disseminate verifiably false information and/or content with the purpose of Harming others;") st.markdown("(e) To generate or disseminate personal identifiable information with the purpose of Harming others;") st.markdown("(f) To generate or disseminate information (including - but not limited to - images, code, posts, articles), and place the information in any public context (including - but not limited to - bot generating tweets) without expressly and intelligibly disclaiming that the information and/or content is machine generated;") st.markdown("(g) To intentionally defame, disparage or otherwise harass others;") st.markdown("(h) To impersonate or attempt to impersonate human beings for purposes of deception;") st.markdown("(i) For fully automated decision making that adversely impacts an individual’s legal rights or otherwise creates or modifies a binding, enforceable obligation without expressly and intelligibly disclaiming that the creation or modification of the obligation is machine generated;") st.markdown("(j) For any Use intended to discriminate against or Harm individuals or groups based on online or offline social behavior or known or predicted personal or personality characteristics;") st.markdown("(k) To intentionally exploit any of the vulnerabilities of a specific group of persons based on their age, social, physical or mental characteristics, in order to materially distort the behavior of a person pertaining to that group in a manner that causes or is likely to cause that person or another person physical or psychological harm;") st.markdown("(l) For any Use intended to discriminate against individuals or groups based on legally protected characteristics or categories;") st.markdown("(m) To provide medical advice or medical results interpretation that is intended to be a substitute for professional medical advice, diagnosis, or treatment;") st.markdown("(n) For fully automated decision making in administration of justice, law enforcement, immigration or asylum processes.")