Spaces:
Runtime error
Runtime error
Download app.py from sujeeshss/textgeneration: direct link, hf CLI and curl.
- Browser
- Download file 469 Bytes
-
https://huggingface.co/spaces/sujeeshss/textgeneration/resolve/main/app.py
- Command line
-
hf download hf://spaces/sujeeshss/textgeneration/app.py
-
curl -L -o app.py https://huggingface.co/spaces/sujeeshss/textgeneration/resolve/main/app.py
469 Bytes
| import streamlit as st | |
| from transformers import pipeline | |
| # Load the sentiment analysis pipeline | |
| classifier = pipeline("text-generation") | |
| # Streamlit app | |
| def main(): | |
| st.title("Text Generation App") | |
| # User input | |
| user_input = st.text_input("Enter a sentence:") | |
| if user_input: | |
| # Perform sentiment analysis | |
| result = classifier(user_input) | |
| # Display results | |
| st.write(result) | |
| if __name__ == "__main__": | |
| main() | |