Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
from transformers import pipeline
|
2 |
import streamlit as st
|
|
|
3 |
|
4 |
# Text generation pipeline
|
5 |
generator = pipeline("text-generation", model="mosaicml/mpt-7b-storywriter", trust_remote_code=True)
|
@@ -7,6 +8,9 @@ generator = pipeline("text-generation", model="mosaicml/mpt-7b-storywriter", tru
|
|
7 |
# Summarization pipeline
|
8 |
summarizer = pipeline("summarization", model="facebook/bart-large-cnn")
|
9 |
|
|
|
|
|
|
|
10 |
# Input text
|
11 |
prompt = st.text_input("Enter a prompt to expand on:")
|
12 |
|
@@ -22,3 +26,7 @@ if prompt:
|
|
22 |
summarized_text = summary[0]['summary_text']
|
23 |
st.write("Summarized Text:")
|
24 |
st.write(summarized_text)
|
|
|
|
|
|
|
|
|
|
1 |
from transformers import pipeline
|
2 |
import streamlit as st
|
3 |
+
from diffusers import DiffusionPipeline
|
4 |
|
5 |
# Text generation pipeline
|
6 |
generator = pipeline("text-generation", model="mosaicml/mpt-7b-storywriter", trust_remote_code=True)
|
|
|
8 |
# Summarization pipeline
|
9 |
summarizer = pipeline("summarization", model="facebook/bart-large-cnn")
|
10 |
|
11 |
+
# Image generation pipeline
|
12 |
+
image_pipe = DiffusionPipeline.from_pretrained("black-forest-labs/FLUX.1-dev")
|
13 |
+
|
14 |
# Input text
|
15 |
prompt = st.text_input("Enter a prompt to expand on:")
|
16 |
|
|
|
26 |
summarized_text = summary[0]['summary_text']
|
27 |
st.write("Summarized Text:")
|
28 |
st.write(summarized_text)
|
29 |
+
|
30 |
+
# Generate an image from the summarized text
|
31 |
+
image = image_pipe(summarized_text).images[0]
|
32 |
+
st.image(image, caption="Generated Image")
|