malper commited on
Commit
d7ef1a8
·
1 Parent(s): 51e02d9

add unikud framework

Browse files
Files changed (1) hide show
  1. app.py +4 -10
app.py CHANGED
@@ -1,17 +1,11 @@
1
  import streamlit as st
2
- from transformers import AutoTokenizer, AutoModel
3
 
4
- with st.spinner('Loading tokenizer and model...'):
5
- tokenizer = AutoTokenizer.from_pretrained("malper/unikud")
6
- model = AutoModel.from_pretrained("malper/unikud")
7
  st.success('Loaded!')
8
 
9
  text = st.text_area('Enter Hebrew text')
10
 
11
  if text:
12
- X = tokenizer([text], return_tensors='pt')
13
- logits = model(**X).logits.detach()[0]
14
- st.write(str(logits))
15
-
16
- # x = st.slider('Select a value')
17
- # st.write(x, 'squared is', x * x)
 
1
  import streamlit as st
2
+ from unikud.framework import Unikud
3
 
4
+ with st.spinner('Loading UNIKUD framework...'):
5
+ u = Unikud()
 
6
  st.success('Loaded!')
7
 
8
  text = st.text_area('Enter Hebrew text')
9
 
10
  if text:
11
+ st.write(u(text))