Spaces:
Runtime error
Runtime error
adding code for model inferencing
Browse files- app.py +21 -0
- requirements.txt +2 -1
app.py
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
from setfit import SetFitModel
|
3 |
+
|
4 |
+
l6_model = SetFitModel.from_pretrained("nayan06/binary-classifier-conversion-intent-1.1-l6")
|
5 |
+
|
6 |
+
st.title("Conversion? Or Not?")
|
7 |
+
|
8 |
+
Text = st.text_input("Enter the sentence")
|
9 |
+
|
10 |
+
|
11 |
+
@st.cache
|
12 |
+
def model_inference(text):
|
13 |
+
prediction = l6_model([text])
|
14 |
+
if prediction == 1:
|
15 |
+
return "Intent-To-Convert"
|
16 |
+
else:
|
17 |
+
return "Others"
|
18 |
+
|
19 |
+
|
20 |
+
st.subheader('Classified Intent Is')
|
21 |
+
st.write(model_inference(Text))
|
requirements.txt
CHANGED
@@ -1,3 +1,4 @@
|
|
1 |
transformers
|
2 |
torch
|
3 |
-
setfit
|
|
|
|
1 |
transformers
|
2 |
torch
|
3 |
+
setfit~=0.3.0
|
4 |
+
streamlit~=1.13.0
|