ranga-godhandaraman commited on
Commit
686bdec
·
verified ·
1 Parent(s): a52c2f0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +24 -22
app.py CHANGED
@@ -1,29 +1,31 @@
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
- # Generate the image using the model
25
- generated_image = pipeline(text_input)
26
 
27
- # Display the generated image
28
- st.image(generated_image, caption='Generated Image', use_column_width=True)
 
 
 
 
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}")