OLIVE2403 commited on
Commit
bc2b947
·
verified ·
1 Parent(s): 5fd45da

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -11
app.py CHANGED
@@ -3,33 +3,35 @@
3
  from transformers import pipeline
4
  import gradio as gr
5
 
6
- # Load FLAN-T5-LARGE pipeline for better outputs
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"Suggest three unique and creative brand names for a startup about {startup_idea}. Separate them with commas."
12
- brand_names = generator(prompt_name, max_length=80, num_return_sequences=1)[0]["generated_text"]
13
 
14
  # Tagline
15
- tagline_prompt = f"Write a catchy, short tagline for a startup about {startup_idea}."
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 in one sentence the brand personality for a startup about {startup_idea}."
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 brand colours with hex codes for a startup about {startup_idea}."
24
  colours = generator(colours_prompt, max_length=40, num_return_sequences=1)[0]['generated_text']
25
 
26
  # Target Audience Description
27
- audience_prompt = f"Describe the ideal target audience for a startup about {startup_idea}."
28
  audience = generator(audience_prompt, max_length=50, num_return_sequences=1)[0]['generated_text']
29
 
30
  # Slogan Options
31
- slogan_prompt = f"Suggest a short, catchy slogan for a startup about {startup_idea}."
32
- slogan = generator(slogan_prompt, max_length=20, num_return_sequences=1)[0]['generated_text']
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 updated outputs and CSS styling
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 Gen AI (FLAN-T5-LARGE).",
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
  )