Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,33 +3,35 @@
|
|
| 3 |
from transformers import pipeline
|
| 4 |
import gradio as gr
|
| 5 |
|
| 6 |
-
# Load FLAN-T5-LARGE pipeline
|
| 7 |
generator = pipeline("text2text-generation", model="google/flan-t5-large")
|
| 8 |
|
| 9 |
def generate_brand_identity(startup_idea):
|
|
|
|
|
|
|
| 10 |
# Brand Names
|
| 11 |
-
prompt_name = f"
|
| 12 |
-
brand_names = generator(prompt_name, max_length=
|
| 13 |
|
| 14 |
# Tagline
|
| 15 |
-
tagline_prompt = f"Write a catchy
|
| 16 |
tagline = generator(tagline_prompt, max_length=30, num_return_sequences=1)[0]['generated_text']
|
| 17 |
|
| 18 |
# Brand Personality Description
|
| 19 |
-
personality_prompt = f"Describe
|
| 20 |
personality = generator(personality_prompt, max_length=50, num_return_sequences=1)[0]['generated_text']
|
| 21 |
|
| 22 |
# Suggested Brand Colours
|
| 23 |
-
colours_prompt = f"Suggest primary and secondary
|
| 24 |
colours = generator(colours_prompt, max_length=40, num_return_sequences=1)[0]['generated_text']
|
| 25 |
|
| 26 |
# Target Audience Description
|
| 27 |
-
audience_prompt = f"
|
| 28 |
audience = generator(audience_prompt, max_length=50, num_return_sequences=1)[0]['generated_text']
|
| 29 |
|
| 30 |
# Slogan Options
|
| 31 |
-
slogan_prompt = f"
|
| 32 |
-
slogan = generator(slogan_prompt, max_length=
|
| 33 |
|
| 34 |
return (
|
| 35 |
brand_names.strip(),
|
|
@@ -40,7 +42,7 @@ def generate_brand_identity(startup_idea):
|
|
| 40 |
slogan.strip()
|
| 41 |
)
|
| 42 |
|
| 43 |
-
# Gradio interface with
|
| 44 |
css = """
|
| 45 |
h1 {
|
| 46 |
text-align: center;
|
|
@@ -73,7 +75,7 @@ iface = gr.Interface(
|
|
| 73 |
gr.Textbox(label="Slogan Options")
|
| 74 |
],
|
| 75 |
title="🌟 Brand Identity Generator",
|
| 76 |
-
description="Generate creative brand names, taglines, brand personality descriptions, colour palettes, target audiences, and slogans for your startup idea using
|
| 77 |
css=css,
|
| 78 |
theme="soft"
|
| 79 |
)
|
|
|
|
| 3 |
from transformers import pipeline
|
| 4 |
import gradio as gr
|
| 5 |
|
| 6 |
+
# Load FLAN-T5-LARGE pipeline
|
| 7 |
generator = pipeline("text2text-generation", model="google/flan-t5-large")
|
| 8 |
|
| 9 |
def generate_brand_identity(startup_idea):
|
| 10 |
+
# Make each prompt practical and targeted
|
| 11 |
+
|
| 12 |
# Brand Names
|
| 13 |
+
prompt_name = f"Generate 3 unique and creative brand names for a startup that offers: {startup_idea}. The names should be catchy and relevant. Separate with commas."
|
| 14 |
+
brand_names = generator(prompt_name, max_length=60, num_return_sequences=1)[0]["generated_text"]
|
| 15 |
|
| 16 |
# Tagline
|
| 17 |
+
tagline_prompt = f"Write a 1-line catchy tagline for a startup that offers: {startup_idea}. Focus on value, not just flair."
|
| 18 |
tagline = generator(tagline_prompt, max_length=30, num_return_sequences=1)[0]['generated_text']
|
| 19 |
|
| 20 |
# Brand Personality Description
|
| 21 |
+
personality_prompt = f"Describe the brand personality for a startup that offers: {startup_idea}. Use descriptive language."
|
| 22 |
personality = generator(personality_prompt, max_length=50, num_return_sequences=1)[0]['generated_text']
|
| 23 |
|
| 24 |
# Suggested Brand Colours
|
| 25 |
+
colours_prompt = f"Suggest two brand colour themes (primary and secondary) with HEX codes for a startup that offers: {startup_idea}."
|
| 26 |
colours = generator(colours_prompt, max_length=40, num_return_sequences=1)[0]['generated_text']
|
| 27 |
|
| 28 |
# Target Audience Description
|
| 29 |
+
audience_prompt = f"Identify the most likely target audience for a startup that offers: {startup_idea}. Include age, profession, or lifestyle."
|
| 30 |
audience = generator(audience_prompt, max_length=50, num_return_sequences=1)[0]['generated_text']
|
| 31 |
|
| 32 |
# Slogan Options
|
| 33 |
+
slogan_prompt = f"Generate 2 short, memorable slogans for a startup that offers: {startup_idea}. Keep them unique and practical."
|
| 34 |
+
slogan = generator(slogan_prompt, max_length=40, num_return_sequences=1)[0]['generated_text']
|
| 35 |
|
| 36 |
return (
|
| 37 |
brand_names.strip(),
|
|
|
|
| 42 |
slogan.strip()
|
| 43 |
)
|
| 44 |
|
| 45 |
+
# Gradio interface with improved text clarity and appearance
|
| 46 |
css = """
|
| 47 |
h1 {
|
| 48 |
text-align: center;
|
|
|
|
| 75 |
gr.Textbox(label="Slogan Options")
|
| 76 |
],
|
| 77 |
title="🌟 Brand Identity Generator",
|
| 78 |
+
description="Generate practical and creative brand names, taglines, brand personality descriptions, colour palettes, target audiences, and slogans for your startup idea using FLAN-T5-LARGE.",
|
| 79 |
css=css,
|
| 80 |
theme="soft"
|
| 81 |
)
|