Spaces:
Sleeping
Sleeping
Commit ·
7f19bde
1
Parent(s): 8e810e5
Update app.py
Browse files1233456788910111213141516171819202122232425262728293031323334import streamlit as stfrom transformers import pipelineimport huggingface_hub
# Create a sentiment analysis pipelinepipe = pipeline("sentiment-analysis")
# Streamlit UIst.title("Sentiment Analysis with Qadoos")st.title("Sentiment Analysis with Transformers")
sentence = st.text_area("Enter a sentence:")
if st.button("Analyze"): if sentence: result = pipe(sentence) st.write("Sentiment:", result[0]['label'], "with confidence:", result[0]['score']) else: st.warning("Please enter a sentence.")
# Deployment-specific codeif __name__ == "__main__": import hugginface_hub
commit_message = "Deploying Sentiment Analysis app" repo_id = "your-huggingface-username/your-repo-name" # Replace with your repo details branch = "main" # Replace with your desired branch
with st.spinner("Deploying to Hugging Face Spaces..."): huggingface_hub.deploy( repo_id=repo_id, branch=branch, commit_message=commit_message, )
st.success("Deployment successful!")app.py+21-2