Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -27,9 +27,8 @@ def generate_image(prompt,gradio_api_key):
|
|
27 |
raise ValueError("Failed to generate image")
|
28 |
|
29 |
def text_and_image_generator(prompt,maxi,cohere_api_key,gradio_api_key):
|
30 |
-
|
31 |
-
|
32 |
-
gradio_api_key = "e35a803cffac3d96f1c364a1bb8ddf00fd702be129881b1acb36f963c0ba86489cad39a6cb6f15f7cbfe919a3c4eb46e"
|
33 |
text = generate_text(f"Generate a story with {prompt}. Conclude the generated story properly.",maxi,cohere_api_key)
|
34 |
image = generate_image(text,gradio_api_key)
|
35 |
title = generate_text(f"title for the story {prompt} within 5 words",5,cohere_api_key)
|
@@ -40,7 +39,7 @@ app = gr.Interface(
|
|
40 |
title="Story and Image Generator",
|
41 |
fn=text_and_image_generator,
|
42 |
inputs = [gr.inputs.Textbox(label="Enter your prompt to generate a story"),
|
43 |
-
gr.inputs.Slider(
|
44 |
outputs= [gr.outputs.Textbox(label="Story title"),gr.outputs.Textbox(label="Story"),gr.outputs.Image(type="pil",label="Image based on the Generated story")],theme="dark"
|
45 |
)
|
46 |
|
|
|
27 |
raise ValueError("Failed to generate image")
|
28 |
|
29 |
def text_and_image_generator(prompt,maxi,cohere_api_key,gradio_api_key):
|
30 |
+
cohere_api_key = "3kUv9DkIN6vtDUhUXFnYyk3cqy53VWuDfC6g3mp4"
|
31 |
+
gradio_api_key = "e35a803cffac3d96f1c364a1bb8ddf00fd702be129881b1acb36f963c0ba86489cad39a6cb6f15f7cbfe919a3c4eb46e"
|
|
|
32 |
text = generate_text(f"Generate a story with {prompt}. Conclude the generated story properly.",maxi,cohere_api_key)
|
33 |
image = generate_image(text,gradio_api_key)
|
34 |
title = generate_text(f"title for the story {prompt} within 5 words",5,cohere_api_key)
|
|
|
39 |
title="Story and Image Generator",
|
40 |
fn=text_and_image_generator,
|
41 |
inputs = [gr.inputs.Textbox(label="Enter your prompt to generate a story"),
|
42 |
+
gr.inputs.Slider(200,1000,label="Story length")],
|
43 |
outputs= [gr.outputs.Textbox(label="Story title"),gr.outputs.Textbox(label="Story"),gr.outputs.Image(type="pil",label="Image based on the Generated story")],theme="dark"
|
44 |
)
|
45 |
|