Ezi Ozoani
		
	commited on
		
		
					Commit 
							
							Β·
						
						7ca1ef7
	
1
								Parent(s):
							
							25cf4f2
								
let the batch patching begin: parent model+ template updates
Browse files- 1_π_form.py +6 -0
- __pycache__/middleMan.cpython-39.pyc +0 -0
- language_model_template1.md +2 -3
- middleMan.py +1 -0
- modelcard_template_new_spec.md +2 -2
- pages/2_π_Model_Details.py +2 -2
- template.md +0 -136
    	
        1_π_form.py
    CHANGED
    
    | @@ -112,6 +112,8 @@ def main(): | |
| 112 | 
             
                        "Model_details_text": "",
         | 
| 113 | 
             
                        "Model_developers": "",
         | 
| 114 | 
             
                        "blog_url":"",
         | 
|  | |
|  | |
| 115 |  | 
| 116 | 
             
                        "Model_how_to": "",
         | 
| 117 |  | 
| @@ -177,6 +179,7 @@ def main(): | |
| 177 | 
             
                st.multiselect("Language(s)", list(languages_map), format_func=lambda x: languages_map[x], help="The language(s) associated with this model. If this is not a text-based model, you should specify whatever lanuage is used in the dataset. For instance, if the dataset's labels are in english, you should select English here.", key=persist("languages"))
         | 
| 178 | 
             
                st.selectbox("License", [""] + list(license_map.values()), help="The license associated with this model.", key=persist("license"))
         | 
| 179 | 
             
                st.selectbox("Library Name", [""] + libraries, help="The name of the library this model came from (Ex. pytorch, timm, spacy, keras, etc.). This is usually automatically detected in model repos, so it is not required.", key=persist('library_name'))
         | 
|  | |
| 180 | 
             
                st.text_input("Datasets (comma separated)", help="The dataset(s) used to train this model. Use dataset id from https://hf.co/datasets.", key=persist("datasets"))
         | 
| 181 | 
             
                st.multiselect("Metrics", available_metrics, help="Metrics used in the training/evaluation of this model. Use metric id from https://hf.co/metrics.", key=persist("metrics"))
         | 
| 182 | 
             
                st.selectbox("Task", [""] + tasks, help="What task does this model aim to solve?", key=persist('task'))
         | 
| @@ -186,6 +189,9 @@ def main(): | |
| 186 | 
             
                st.text_input("Related GitHub Repository", help="Link to a GitHub repository used in the development of this model", key=persist("github_url"))
         | 
| 187 | 
             
                st.text_area("Bibtex Citation", help="Bibtex citations for related work", key=persist("bibtex_citations"))
         | 
| 188 | 
             
                st.text_input("Carbon Emitted:", help="You can estimate carbon emissions using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700)", key=persist("Model_c02_emitted"))
         | 
|  | |
|  | |
|  | |
| 189 | 
             
                # warnings setting
         | 
| 190 | 
             
                languages=st.session_state.languages or None
         | 
| 191 | 
             
                license=st.session_state.license or None
         | 
|  | |
| 112 | 
             
                        "Model_details_text": "",
         | 
| 113 | 
             
                        "Model_developers": "",
         | 
| 114 | 
             
                        "blog_url":"",
         | 
| 115 | 
            +
                        "Parent_Model_url":"",
         | 
| 116 | 
            +
                        "Parent_Model_name":"",
         | 
| 117 |  | 
| 118 | 
             
                        "Model_how_to": "",
         | 
| 119 |  | 
|  | |
| 179 | 
             
                st.multiselect("Language(s)", list(languages_map), format_func=lambda x: languages_map[x], help="The language(s) associated with this model. If this is not a text-based model, you should specify whatever lanuage is used in the dataset. For instance, if the dataset's labels are in english, you should select English here.", key=persist("languages"))
         | 
| 180 | 
             
                st.selectbox("License", [""] + list(license_map.values()), help="The license associated with this model.", key=persist("license"))
         | 
| 181 | 
             
                st.selectbox("Library Name", [""] + libraries, help="The name of the library this model came from (Ex. pytorch, timm, spacy, keras, etc.). This is usually automatically detected in model repos, so it is not required.", key=persist('library_name'))
         | 
| 182 | 
            +
                st.text_input(" Parent Model (URL)", help="Please provide the URL link to the parent model", key=persist("Parent_Model_name"))
         | 
| 183 | 
             
                st.text_input("Datasets (comma separated)", help="The dataset(s) used to train this model. Use dataset id from https://hf.co/datasets.", key=persist("datasets"))
         | 
| 184 | 
             
                st.multiselect("Metrics", available_metrics, help="Metrics used in the training/evaluation of this model. Use metric id from https://hf.co/metrics.", key=persist("metrics"))
         | 
| 185 | 
             
                st.selectbox("Task", [""] + tasks, help="What task does this model aim to solve?", key=persist('task'))
         | 
|  | |
| 189 | 
             
                st.text_input("Related GitHub Repository", help="Link to a GitHub repository used in the development of this model", key=persist("github_url"))
         | 
| 190 | 
             
                st.text_area("Bibtex Citation", help="Bibtex citations for related work", key=persist("bibtex_citations"))
         | 
| 191 | 
             
                st.text_input("Carbon Emitted:", help="You can estimate carbon emissions using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700)", key=persist("Model_c02_emitted"))
         | 
| 192 | 
            +
               
         | 
| 193 | 
            +
               
         | 
| 194 | 
            +
                
         | 
| 195 | 
             
                # warnings setting
         | 
| 196 | 
             
                languages=st.session_state.languages or None
         | 
| 197 | 
             
                license=st.session_state.license or None
         | 
    	
        __pycache__/middleMan.cpython-39.pyc
    CHANGED
    
    | Binary files a/__pycache__/middleMan.cpython-39.pyc and b/__pycache__/middleMan.cpython-39.pyc differ | 
|  | 
    	
        language_model_template1.md
    CHANGED
    
    | @@ -135,12 +135,11 @@ | |
| 135 | 
             
            - **Model type:** {{ model_type | default("Language model", true)}}
         | 
| 136 | 
             
            - **Language(s) (NLP):** {{ language | join(', ') | default("More information needed", true)}}
         | 
| 137 | 
             
            - **License:** {{ model_license | default("More information needed", true)}}
         | 
| 138 | 
            -
            - **Related Models:** {{ related_models | join(', ') | default("More information needed", true)}}
         | 
| 139 | 
            -
               | 
| 140 | 
             
            - **Resources for more information:** {{ more_resources | default("More information needed", true)}}
         | 
| 141 | 
             
            {{ "    - [GitHub Repo]({0})".format(repo_link) if repo_link }}
         | 
| 142 | 
             
            {{ "    - [Associated Paper]({0})".format(paper_link) if paper_link }}
         | 
| 143 | 
            -
            {{ "    - [Blog Post]({0})".format(blog_link) if blog_link }}
         | 
| 144 |  | 
| 145 | 
             
            # Uses
         | 
| 146 |  | 
|  | |
| 135 | 
             
            - **Model type:** {{ model_type | default("Language model", true)}}
         | 
| 136 | 
             
            - **Language(s) (NLP):** {{ language | join(', ') | default("More information needed", true)}}
         | 
| 137 | 
             
            - **License:** {{ model_license | default("More information needed", true)}}
         | 
| 138 | 
            +
            - **Related Models:** {{ related_models | join(', ') | default("More information needed", true)}} 
         | 
| 139 | 
            +
            {{ "    -  [Parent Model]({0})".format(repo_link) if parent_model_link }}
         | 
| 140 | 
             
            - **Resources for more information:** {{ more_resources | default("More information needed", true)}}
         | 
| 141 | 
             
            {{ "    - [GitHub Repo]({0})".format(repo_link) if repo_link }}
         | 
| 142 | 
             
            {{ "    - [Associated Paper]({0})".format(paper_link) if paper_link }}
         | 
|  | |
| 143 |  | 
| 144 | 
             
            # Uses
         | 
| 145 |  | 
    	
        middleMan.py
    CHANGED
    
    | @@ -26,6 +26,7 @@ def parse_into_jinja_markdown(): | |
| 26 | 
             
                return (temp.render(model_id = st.session_state["model_name"],
         | 
| 27 | 
             
                    language = st.session_state["languages"],
         | 
| 28 | 
             
                    the_model_description = st.session_state["model_description"],developers=st.session_state["Model_developers"],shared_by = st.session_state["shared_by"],model_license = st.session_state['license'],
         | 
|  | |
| 29 | 
             
                        direct_use = st.session_state["Direct_Use"], downstream_use = st.session_state["Downstream_Use"],out_of_scope_use = st.session_state["Out-of-Scope_Use"],
         | 
| 30 | 
             
                        bias_risks_limitations = st.session_state["Model_Limits_n_Risks"], bias_recommendations = st.session_state['Recommendations'],
         | 
| 31 | 
             
                        model_examination = st.session_state['Model_examin'],
         | 
|  | |
| 26 | 
             
                return (temp.render(model_id = st.session_state["model_name"],
         | 
| 27 | 
             
                    language = st.session_state["languages"],
         | 
| 28 | 
             
                    the_model_description = st.session_state["model_description"],developers=st.session_state["Model_developers"],shared_by = st.session_state["shared_by"],model_license = st.session_state['license'],
         | 
| 29 | 
            +
                    parent_model_link = st.session_state['Parent_Model_url'],
         | 
| 30 | 
             
                        direct_use = st.session_state["Direct_Use"], downstream_use = st.session_state["Downstream_Use"],out_of_scope_use = st.session_state["Out-of-Scope_Use"],
         | 
| 31 | 
             
                        bias_risks_limitations = st.session_state["Model_Limits_n_Risks"], bias_recommendations = st.session_state['Recommendations'],
         | 
| 32 | 
             
                        model_examination = st.session_state['Model_examin'],
         | 
    	
        modelcard_template_new_spec.md
    CHANGED
    
    | @@ -56,8 +56,8 @@ | |
| 56 | 
             
            - **Model type:** Language model
         | 
| 57 | 
             
            - **Language(s) (NLP):** {{ language | default("More information needed", true)}}
         | 
| 58 | 
             
            - **License:** {{ license | default("More information needed", true)}}
         | 
| 59 | 
            -
            - **Related Models:** {{ related_models | default("More information needed", true)}}
         | 
| 60 | 
            -
               | 
| 61 | 
             
            - **Resources for more information:** {{ more_resources | default("More information needed", true)}}
         | 
| 62 | 
             
            {{ "    - [GitHub Repo]({0})".format(repo_link) if repo_link }}
         | 
| 63 | 
             
            {{ "    - [Associated Paper]({0})".format(paper_link) if paper_link }}
         | 
|  | |
| 56 | 
             
            - **Model type:** Language model
         | 
| 57 | 
             
            - **Language(s) (NLP):** {{ language | default("More information needed", true)}}
         | 
| 58 | 
             
            - **License:** {{ license | default("More information needed", true)}}
         | 
| 59 | 
            +
            - **Related Models:** {{ related_models | join(', ') | default("More information needed", true)}} 
         | 
| 60 | 
            +
            {{ "    -  [Parent Model]({0})".format(repo_link) if parent_model_link }}
         | 
| 61 | 
             
            - **Resources for more information:** {{ more_resources | default("More information needed", true)}}
         | 
| 62 | 
             
            {{ "    - [GitHub Repo]({0})".format(repo_link) if repo_link }}
         | 
| 63 | 
             
            {{ "    - [Associated Paper]({0})".format(paper_link) if paper_link }}
         | 
    	
        pages/2_π_Model_Details.py
    CHANGED
    
    | @@ -31,8 +31,8 @@ def get_cached_data(): | |
| 31 |  | 
| 32 | 
             
            def cs_body():
         | 
| 33 | 
             
                license_map= get_cached_data()
         | 
| 34 | 
            -
                Supervision_learning_method_list = ["Unsupervised","Semi-supervised","Self-supervised","Supervised"]
         | 
| 35 | 
            -
                Machine_Learning_Type_list = ["Neural Network","SVM","Decision Trees" | 
| 36 | 
             
                Modality_List = ["Computer Vision","Natural Language Processing","Audio","Speech","Multimodal","Tabular"]
         | 
| 37 |  | 
| 38 | 
             
                #st.set_page_config(layout="wide") ## not yet supported on the hub
         | 
|  | |
| 31 |  | 
| 32 | 
             
            def cs_body():
         | 
| 33 | 
             
                license_map= get_cached_data()
         | 
| 34 | 
            +
                Supervision_learning_method_list = ["Unsupervised","Semi-supervised","Self-supervised","Supervised","Reinforcement Learning"]
         | 
| 35 | 
            +
                Machine_Learning_Type_list = ["Neural Network","SVM","Decision Trees"]
         | 
| 36 | 
             
                Modality_List = ["Computer Vision","Natural Language Processing","Audio","Speech","Multimodal","Tabular"]
         | 
| 37 |  | 
| 38 | 
             
                #st.set_page_config(layout="wide") ## not yet supported on the hub
         | 
    	
        template.md
    DELETED
    
    | @@ -1,136 +0,0 @@ | |
| 1 | 
            -
            ---
         | 
| 2 | 
            -
            {{ card_data }}
         | 
| 3 | 
            -
            ---
         | 
| 4 | 
            -
             | 
| 5 | 
            -
            # {{ model_id | default("MyModelName", true)}}
         | 
| 6 | 
            -
             | 
| 7 | 
            -
            ## Table of Contents
         | 
| 8 | 
            -
            - [{{ model_id | default("MyModelName", true)}}](#-model_id--defaultmymodelname-true)
         | 
| 9 | 
            -
              - [Table of Contents](#table-of-contents)
         | 
| 10 | 
            -
              - [Model Details](#model-details)
         | 
| 11 | 
            -
              - [How to Get Started with the Model](#how-to-get-started-with-the-model)
         | 
| 12 | 
            -
              - [Uses](#uses)
         | 
| 13 | 
            -
                  - [Direct Use](#direct-use)
         | 
| 14 | 
            -
                  - [Downstream Use](#downstream-use)
         | 
| 15 | 
            -
                  - [Misuse and Out-of-scope Use](#misuse-and-out-of-scope-use)
         | 
| 16 | 
            -
              - [Limitations and Biases](#limitations-and-biases)
         | 
| 17 | 
            -
              - [Training](#training)
         | 
| 18 | 
            -
                  - [Training Data](#training-data)
         | 
| 19 | 
            -
                  - [Training Procedure](#training-procedure)
         | 
| 20 | 
            -
              - [Evaluation Results](#evaluation-results)
         | 
| 21 | 
            -
              - [Environmental Impact](#environmental-impact)
         | 
| 22 | 
            -
              - [Citation Information](#citation-information)
         | 
| 23 | 
            -
             | 
| 24 | 
            -
             
         | 
| 25 | 
            -
            <model_details>
         | 
| 26 | 
            -
            ## Model Details
         | 
| 27 | 
            -
             | 
| 28 | 
            -
            <!-- Give an overview of your model, the relevant research paper, who trained it, etc.  -->
         | 
| 29 | 
            -
             | 
| 30 | 
            -
            {{ model_description if model_description else "[More Information Needed]" }}
         | 
| 31 | 
            -
             | 
| 32 | 
            -
            - Developed by: {{ authors if authors }}
         | 
| 33 | 
            -
            - Language(s): {{ languages }}
         | 
| 34 | 
            -
            - License: This model is licensed under the {{ license }}{{ " license" if "license" not in license.lower() }}
         | 
| 35 | 
            -
            - Resources for more information:
         | 
| 36 | 
            -
            {{ "  - [Research Paper](" + paper_url + ")" if paper_url }}
         | 
| 37 | 
            -
            {{ "  - [GitHub Repo](" + github_url + ")" if github_url }}
         | 
| 38 | 
            -
             | 
| 39 | 
            -
            </model_details>
         | 
| 40 | 
            -
             | 
| 41 | 
            -
            <how_to_start>
         | 
| 42 | 
            -
            ## How to Get Started with the Model 
         | 
| 43 | 
            -
             | 
| 44 | 
            -
            Use the code below to get started with the model.
         | 
| 45 | 
            -
             | 
| 46 | 
            -
            ```python
         | 
| 47 | 
            -
            # A nice code snippet here that describes how to use the model...
         | 
| 48 | 
            -
            ```
         | 
| 49 | 
            -
            </how_to_start>
         | 
| 50 | 
            -
             | 
| 51 | 
            -
            <uses>
         | 
| 52 | 
            -
             | 
| 53 | 
            -
            ## Uses
         | 
| 54 | 
            -
             | 
| 55 | 
            -
            #### Direct Use
         | 
| 56 | 
            -
             | 
| 57 | 
            -
            <!-- Describe what kind of tasks this model can be used for directly or problems it can solve. -->
         | 
| 58 | 
            -
             | 
| 59 | 
            -
            [More Information Needed]
         | 
| 60 | 
            -
             | 
| 61 | 
            -
            #### Downstream Use
         | 
| 62 | 
            -
             | 
| 63 | 
            -
            <!-- Describe how this model could be leveraged by a downstream model (if applicable) -->
         | 
| 64 | 
            -
             | 
| 65 | 
            -
            [More Information Needed]
         | 
| 66 | 
            -
             | 
| 67 | 
            -
            #### Misuse and Out-of-scope Use
         | 
| 68 | 
            -
             | 
| 69 | 
            -
            <!-- Describe ways in which this model ***should not*** be used. -->
         | 
| 70 | 
            -
             | 
| 71 | 
            -
            [More Information Needed]
         | 
| 72 | 
            -
            </uses>
         | 
| 73 | 
            -
             | 
| 74 | 
            -
            <Limitations_and_Biases>
         | 
| 75 | 
            -
             | 
| 76 | 
            -
            ## Limitations and Biases
         | 
| 77 | 
            -
             | 
| 78 | 
            -
            <!-- Describe limitations and biases of this model or models of it's type. -->
         | 
| 79 | 
            -
             | 
| 80 | 
            -
            **CONTENT WARNING: Readers should be aware this section contains content that is disturbing, offensive, and can propogate historical and current stereotypes.**
         | 
| 81 | 
            -
             | 
| 82 | 
            -
            [More Information Needed]
         | 
| 83 | 
            -
             | 
| 84 | 
            -
            </Limitations_and_Biases>
         | 
| 85 | 
            -
             | 
| 86 | 
            -
            <Training>
         | 
| 87 | 
            -
             | 
| 88 | 
            -
            ## Training
         | 
| 89 | 
            -
             | 
| 90 | 
            -
            #### Training Data
         | 
| 91 | 
            -
             | 
| 92 | 
            -
            <!-- Describe the dataset used to train this model. -->
         | 
| 93 | 
            -
            <!-- Refer to data card if dataset is provided and exists on the hub -->
         | 
| 94 | 
            -
             | 
| 95 | 
            -
            See the data card for additional information.
         | 
| 96 | 
            -
             | 
| 97 | 
            -
            #### Training Procedure
         | 
| 98 | 
            -
             | 
| 99 | 
            -
            <!-- Describe the preprocessing, hardware used, training hyperparameters, etc. -->
         | 
| 100 | 
            -
             | 
| 101 | 
            -
            [More Information Needed]
         | 
| 102 | 
            -
             | 
| 103 | 
            -
            </Training>
         | 
| 104 | 
            -
             | 
| 105 | 
            -
            <Eval_Results>
         | 
| 106 | 
            -
            ## Evaluation Results
         | 
| 107 | 
            -
             | 
| 108 | 
            -
            <!-- Describe evaluation results of this model across any datasets it was evaluated on. -->
         | 
| 109 | 
            -
             | 
| 110 | 
            -
            [More Information Needed]
         | 
| 111 | 
            -
             | 
| 112 | 
            -
            </Eval_Results>
         | 
| 113 | 
            -
             | 
| 114 | 
            -
            <E_Impact>
         | 
| 115 | 
            -
            ## Environmental Impact
         | 
| 116 | 
            -
             | 
| 117 | 
            -
            <!-- Provide information to document the environmental impact of this model -->
         | 
| 118 | 
            -
             | 
| 119 | 
            -
            You can estimate carbon emissions using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700)
         | 
| 120 | 
            -
             | 
| 121 | 
            -
            - **Hardware Type:** 
         | 
| 122 | 
            -
            - **Hours used:** 
         | 
| 123 | 
            -
            - **Cloud Provider:** 
         | 
| 124 | 
            -
            - **Compute Region:** 
         | 
| 125 | 
            -
            - **Carbon Emitted:** {{ emissions if emissions }}
         | 
| 126 | 
            -
             | 
| 127 | 
            -
            </E_Impact>
         | 
| 128 | 
            -
             | 
| 129 | 
            -
            <Cite>
         | 
| 130 | 
            -
             | 
| 131 | 
            -
            ## Citation Information
         | 
| 132 | 
            -
             | 
| 133 | 
            -
            ```bibtex
         | 
| 134 | 
            -
            {{ bibtex_citations if bibtex_citations }}
         | 
| 135 | 
            -
            ```
         | 
| 136 | 
            -
            </Cite>
         | 
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | 
