peace4ever commited on
Commit
79113c6
1 Parent(s): 1d092d7

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +14 -0
app.py ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from transformers import AutoTokenizer, AutoModelForSequenceClassification
3
+
4
+ model_name = "peace4ever/roberta-large-finetuned-mongolian_v4"
5
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
6
+ model = AutoModelForSequenceClassification.from_pretrained(model_name)
7
+
8
+ text = st.text_area("Өгүүлбэр оруулна уу?")
9
+ encoded_input = tokenizer(text, return_tensors="pt")
10
+ output = model(**encoded_input)
11
+
12
+ st.json(output)
13
+
14
+