Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -609,32 +609,17 @@ def compute_model_card_evaluation_results(tokenizer, model_checkpoint, raw_datas
|
|
609 |
result = trainer.evaluate()
|
610 |
return result
|
611 |
|
612 |
-
"""
|
613 |
-
|
614 |
-
def main():
|
615 |
-
try:
|
616 |
-
interface = GradioInterface()
|
617 |
-
demo = interface.create_interface()
|
618 |
-
demo.launch(
|
619 |
-
server_name="0.0.0.0",
|
620 |
-
show_error=True,
|
621 |
-
share=True
|
622 |
-
)
|
623 |
-
except Exception as e:
|
624 |
-
logger.error(f"Error starting application: {e}")
|
625 |
-
raise
|
626 |
-
"""
|
627 |
-
|
628 |
-
|
629 |
if __name__ == "__main__":
|
630 |
|
631 |
st.title("Hugging Face Model Evaluation Demo")
|
632 |
|
633 |
# Create an input text box
|
634 |
-
input_text = st.
|
635 |
-
|
|
|
636 |
model_checkpoint = "sgugger/glue-mrpc"
|
637 |
-
dataset_name = "nyu-mll/glue"
|
|
|
638 |
metric = load("glue", "mrpc")
|
639 |
tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)
|
640 |
in_container = False
|
@@ -644,4 +629,4 @@ if __name__ == "__main__":
|
|
644 |
tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)
|
645 |
output = compute_model_card_evaluation_results(tokenizer, model_checkpoint, raw_datasets, metric)
|
646 |
print(json.dumps(output))
|
647 |
-
st.
|
|
|
609 |
result = trainer.evaluate()
|
610 |
return result
|
611 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
612 |
if __name__ == "__main__":
|
613 |
|
614 |
st.title("Hugging Face Model Evaluation Demo")
|
615 |
|
616 |
# Create an input text box
|
617 |
+
input_text = st.text_area("Enter model and dataset identifiers", "")
|
618 |
+
|
619 |
+
# hardcode input data
|
620 |
model_checkpoint = "sgugger/glue-mrpc"
|
621 |
+
dataset_name = "nyu-mll/glue"
|
622 |
+
|
623 |
metric = load("glue", "mrpc")
|
624 |
tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)
|
625 |
in_container = False
|
|
|
629 |
tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)
|
630 |
output = compute_model_card_evaluation_results(tokenizer, model_checkpoint, raw_datasets, metric)
|
631 |
print(json.dumps(output))
|
632 |
+
st.text_area(label="Output Data:", value=output, height=350)
|