Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import torch
|
| 3 |
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
|
|
@@ -626,9 +627,15 @@ def main():
|
|
| 626 |
|
| 627 |
|
| 628 |
if __name__ == "__main__":
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 629 |
model_checkpoint = model_checkpoint
|
| 630 |
raw_datasets = load_dataset(dataset_name, "mrpc")
|
| 631 |
metric = load("glue", "mrpc")
|
| 632 |
tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)
|
| 633 |
output = compute_model_card_evaluation_results(tokenizer, model_checkpoint, raw_datasets, metric)
|
| 634 |
print(json.dumps(output))
|
|
|
|
|
|
| 1 |
+
import streamlit as st
|
| 2 |
import gradio as gr
|
| 3 |
import torch
|
| 4 |
from transformers import AutoModelForCausalLM, AutoTokenizer, pipeline
|
|
|
|
| 627 |
|
| 628 |
|
| 629 |
if __name__ == "__main__":
|
| 630 |
+
model_checkpoint = "sgugger/glue-mrpc"
|
| 631 |
+
dataset_name = "nyu-mll/glue"
|
| 632 |
+
metric = load("glue", "mrpc")
|
| 633 |
+
tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)
|
| 634 |
+
in_container = False
|
| 635 |
model_checkpoint = model_checkpoint
|
| 636 |
raw_datasets = load_dataset(dataset_name, "mrpc")
|
| 637 |
metric = load("glue", "mrpc")
|
| 638 |
tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)
|
| 639 |
output = compute_model_card_evaluation_results(tokenizer, model_checkpoint, raw_datasets, metric)
|
| 640 |
print(json.dumps(output))
|
| 641 |
+
st.write(output)
|