ksatzke commited on
Commit
e085d1b
·
verified ·
1 Parent(s): 0602041

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -15
app.py CHANGED
@@ -280,20 +280,28 @@ if __name__ == "__main__":
280
 
281
  st.title("Hugging Face Model Evaluation Demo")
282
 
283
- # Create an input text box
284
- input_text = st.text_area("Enter model and dataset identifiers", "")
285
 
286
- # hardcode input data
287
- model_checkpoint = "sgugger/glue-mrpc"
288
- dataset_name = "nyu-mll/glue"
 
 
 
 
 
 
 
 
 
289
 
290
- metric = load("glue", "mrpc")
291
- tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)
292
- in_container = False
293
- model_checkpoint = model_checkpoint
294
- raw_datasets = load_dataset(dataset_name, "mrpc")
295
- metric = load("glue", "mrpc")
296
- tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)
297
- output = compute_model_card_evaluation_results(tokenizer, model_checkpoint, raw_datasets, metric)
298
- print(json.dumps(output))
299
- st.text_area(label="Output Data:", value=output, height=350)
 
280
 
281
  st.title("Hugging Face Model Evaluation Demo")
282
 
283
+ with st.form("my_form"):
 
284
 
285
+ # Create an input text box
286
+ input_text1 = st.text_area("Enter model and dataset identifiers", "")
287
+ input_text2 = st.text_area("Enter model and dataset identifiers", "")
288
+
289
+ # Every form must have a submit button.
290
+ submitted = st.form_submit_button("Submit")
291
+
292
+ if submitted:
293
+ print(input_text1, input_text2)
294
+ # hardcode input data
295
+ model_checkpoint = "sgugger/glue-mrpc"
296
+ dataset_name = "nyu-mll/glue"
297
 
298
+ metric = load("glue", "mrpc")
299
+ tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)
300
+ in_container = False
301
+ model_checkpoint = model_checkpoint
302
+ raw_datasets = load_dataset(dataset_name, "mrpc")
303
+ metric = load("glue", "mrpc")
304
+ tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)
305
+ output = compute_model_card_evaluation_results(tokenizer, model_checkpoint, raw_datasets, metric)
306
+ print(json.dumps(output))
307
+ st.text_area(label="Output Data:", value=output, height=350)