Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,29 +1,31 @@
|
|
1 |
-
|
2 |
-
|
3 |
|
4 |
-
|
5 |
-
|
6 |
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
|
12 |
-
import streamlit as st
|
13 |
-
from diffusers import DiffusionPipeline
|
14 |
-
|
15 |
-
# Load the stable-diffusion-2-1 model from diffusers
|
16 |
-
pipeline = DiffusionPipeline.from_pretrained("stabilityai/sd-turbo")
|
17 |
|
18 |
-
#
|
19 |
-
|
20 |
|
21 |
-
#
|
22 |
-
|
23 |
-
if text_input:
|
24 |
-
# Generate the image using the model
|
25 |
-
generated_image = pipeline(text_input)
|
26 |
|
27 |
-
|
28 |
-
|
|
|
|
|
|
|
|
|
29 |
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
from transformers import pipeline
|
3 |
|
4 |
+
pipe = pipeline('sentiment-analysis')
|
5 |
+
text= st.text_area('enter some text')
|
6 |
|
7 |
+
if st.button('Submit'):
|
8 |
+
if text:
|
9 |
+
out = pipe(text)
|
10 |
+
st.write(out)
|
11 |
|
12 |
+
# import streamlit as st
|
13 |
+
# from diffusers import DiffusionPipeline
|
|
|
|
|
|
|
14 |
|
15 |
+
# # Load the stable-diffusion-2-1 model from diffusers
|
16 |
+
# pipeline = DiffusionPipeline.from_pretrained("stabilityai/sd-turbo")
|
17 |
|
18 |
+
# # Get input text from the user
|
19 |
+
# text_input = st.text_area('Enter some text')
|
|
|
|
|
|
|
20 |
|
21 |
+
# # Add a submit button
|
22 |
+
# if st.button('Generate Image'):
|
23 |
+
# if text_input:
|
24 |
+
# try:
|
25 |
+
# # Generate the image using the model
|
26 |
+
# generated_image = pipeline(text_input)
|
27 |
|
28 |
+
# # Display the generated image
|
29 |
+
# st.image(generated_image, caption='Generated Image', use_column_width=True)
|
30 |
+
# except Exception as e:
|
31 |
+
# st.error(f"An error occurred: {e}")
|