Spaces:
Sleeping
Sleeping
Commit ·
7f19bde
1
Parent(s): 8e810e5
Update app.py
Browse files123456789101112131415import streamlit as stfrom transformers import pipelineimport huggingface_hub# Create a sentiment analysis pipelinepipe = pipeline("sentiment-analysis")# Streamlit UIst.title("Sentiment Analysis with Qadoos")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.")12345678910111213141516171819202122232425262728293031323334import streamlit as stfrom transformers import pipeline# Create a sentiment analysis pipelinepipe = pipeline("sentiment-analysis")# Streamlit UIst.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_hubcommit_message = "Deploying Sentiment Analysis app"repo_id = "your-huggingface-username/your-repo-name" # Replace with your repo detailsbranch = "main" # Replace with your desired branchwith 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