Spaces:
Runtime error
Runtime error
Add IMDB
Browse files25 unmodified lines2627282930313215 unmodified lines4849505152535455565758599 unmodified lines697071727374759 unmodified lines858687888925 unmodified lines}# TODO: remove this hardcorded logic and accept any dataset on the HubDATASETS_TO_EVALUATE = ["emotion", "conll2003"]dataset_name = st.selectbox("Select a dataset", [f"lewtun/autoevaluate__{dset}" for dset in DATASETS_TO_EVALUATE])15 unmodified linesselected_split = st.selectbox("Select a split", split_names, index=split_names.index(eval_split))col_mapping = metadata[0]["col_mapping"]col_names = list(col_mapping.values())# TODO: figure out how to get all dataset column names (i.e. features) without download dataset itselfst.markdown("**Map your data columns**")col1, col2 = st.columns(2)with col1:st.markdown("`text` column")st.text("")9 unmodified linesselected_models = st.multiselect("Select the models you wish to evaluate", compatible_models, compatible_models[0])submit_button = st.form_submit_button("Make Submission")if submit_button:for model in selected_models:9 unmodified linesjson_resp = http_post(path="/evaluate/create", payload=payload, token=HF_TOKEN, domain=AUTOTRAIN_BACKEND_API).json()st.success(f"β Successfully submitted model {model} for evaluation with job ID {json_resp['id']}")25 unmodified lines2627282930313233343536373839404142434415 unmodified lines60616263646566676869707172739 unmodified lines838485868788899 unmodified lines9910010110210310410510610710810911011111211325 unmodified lines}# TODO: remove this hardcorded logic and accept any dataset on the HubDATASETS_TO_EVALUATE = ["emotion", "conll2003", "imdb"]############## APP ##############st.title("Evaluation as a Service")st.markdown("""Welcome to Hugging Face's Evaluation as a Service! This application allowsyou to evaluate any π€ Transformers model on the Hub. Please select thedataset and configuration below.""")dataset_name = st.selectbox("Select a dataset", [f"lewtun/autoevaluate__{dset}" for dset in DATASETS_TO_EVALUATE])15 unmodified linesselected_split = st.selectbox("Select a split", split_names, index=split_names.index(eval_split))col_mapping = metadata[0]["col_mapping"]col_names = list(col_mapping.keys())# TODO: figure out how to get all dataset column names (i.e. features) without download dataset itselfst.markdown("**Map your data columns**")col1, col2 = st.columns(2)# TODO: find a better way to layout these items# TODO: propagate this information to payloadwith col1:st.markdown("`text` column")st.text("")9 unmodified linesselected_models = st.multiselect("Select the models you wish to evaluate", compatible_models, compatible_models[0])submit_button = st.form_submit_button("Make submission")if submit_button:for model in selected_models:9 unmodified linesjson_resp = http_post(path="/evaluate/create", payload=payload, token=HF_TOKEN, domain=AUTOTRAIN_BACKEND_API).json()if json_resp["status"] == 1:st.success(f"β Successfully submitted model {model} for evaluation with job ID {json_resp['id']}")st.markdown(f"""Evaluation takes appoximately 1 hour to complete, so grab a β or π΅ while you wait:* π Click [here](https://huggingface.co/spaces/huggingface/leaderboards) to view the results from your submission* πΎ Click [here](https://huggingface.co/datasets/autoevaluate/eval-staging-{json_resp['id']}) to view the stored predictions on the Hugging Face Hub""")else:st.error("π Oh noes, there was an error submitting your submission!")
app.py+29-5