Spaces:
Runtime error
Runtime error
import streamlit as st | |
from transformers import pipeline | |
pipe = pipeline('sentiment-analysis') | |
text= st.text_area('enter some text') | |
if st.button('Submit'): | |
if text: | |
out = pipe(text) | |
st.write(out) | |
# import streamlit as st | |
# from diffusers import DiffusionPipeline | |
# # Load the stable-diffusion-2-1 model from diffusers | |
# pipeline = DiffusionPipeline.from_pretrained("stabilityai/sd-turbo") | |
# # Get input text from the user | |
# text_input = st.text_area('Enter some text') | |
# # Add a submit button | |
# if st.button('Generate Image'): | |
# if text_input: | |
# try: | |
# # Generate the image using the model | |
# generated_image = pipeline(text_input) | |
# # Display the generated image | |
# st.image(generated_image, caption='Generated Image', use_column_width=True) | |
# except Exception as e: | |
# st.error(f"An error occurred: {e}") | |