roberta-base-mr / app.py
hassiahk's picture
Add Streamlit template
c07af09
raw history blame
No virus
722 Bytes
import json
import streamlit as st
from transformers import AutoTokenizer, RobertaForSequenceClassification
with open("config.json") as f:
cfg = json.loads(f.read())
# @st.cache(allow_output_mutation=True)
# def load_model():
# tokenizer = AutoTokenizer.from_pretrained(cfg["model_name_or_path"])
# model = RobertaForSequenceClassification.from_pretrained(cfg["model_name_or_path"])
st.title("RoBERTa Marathi")
# with st.spinner("Loading model..."):
# generator, tokenizer = load_model()
input_text = st.text_input("Text:")
predict_button = st.button("Predict")
if predict_button:
with st.spinner("Generating prediction..."):
# Get prediction here
st.write("Predicted Label")