Spaces:
Runtime error
Runtime error
File size: 1,168 Bytes
2893724 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
import streamlit as st
from transformers import AutoModelForSequenceClassification, AutoTokenizer
@st.cache()
def get_model(model_name):
return AutoModelForSequenceClassification.from_pretrained(model_name)
@st.cache()
def get_tokenizer(tokenizer_name):
return AutoTokenizer.from_pretrained(tokenizer_name, use_fast=True)
def body():
st.title("Evaluate using *ferret* !")
st.markdown(
"""
### 👋 Hi!
Insert down below your text, choose a model and fire up ferret. We will use
*ferret* to:
1. produce explanations with all supported methods
2. evaluate explanations on state-of-the-art **faithfulness metrics**.
"""
)
col1, col2 = st.columns([1, 1])
with col1:
model_name = st.text_input("HF Model", "g8a9/bert-base-cased_ami18")
with col2:
tokenizer_name = st.text_input("HF Tokenizer", "bert-base-cased")
text = st.text_input("Text")
compute = st.button("Compute")
if text and compute and model_name and tokenizer_name:
st.text("hellp")
# model = get_model(model_name)
# tokenizer = get_tokenizer(tokenizer_name)
|