ckomiya commited on
Commit
6f61bcd
·
1 Parent(s): 22e8bd5

agregando req y streamlit app

Browse files
Files changed (2) hide show
  1. app.py +17 -0
  2. requirements.txt +4 -0
app.py ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from transformers import pipeline
3
+
4
+ st.title("Hugging Face Demo")
5
+
6
+ text = st.text_input("Enter text to analyze")
7
+
8
+ @st.cache_resource
9
+ def get_model():
10
+ return pipeline("sentiment-analysis")
11
+
12
+ model = get_model()
13
+
14
+ if text:
15
+ result = model(text)
16
+ st.write("Sentiment:", result[0]["label"])
17
+ st.write("Confidence:", result[0]["score"])
requirements.txt ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ streamlit
2
+ transformers
3
+ torch
4
+