unikud / app.py
malper's picture
Update app.py
e5a7a6b
raw
history blame
No virus
492 Bytes
import streamlit as st
from transformers import AutoTokenizer, AutoModel
with st.spinner('Loading tokenizer and model...'):
tokenizer = AutoTokenizer.from_pretrained("malper/unikud")
model = AutoModel.from_pretrained("malper/unikud")
st.success('Loaded!')
text = st.text_area('Enter Hebrew text')
if text:
X = tokenizer([text], return_tensors='pt')
logits = model(**X).logits.detach()[0]
st.write(str(logits))
# x = st.slider('Select a value')
# st.write(x, 'squared is', x * x)