Spaces:
Running
Running
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
INFLUENCER_PERSONA = """
|
| 4 |
+
You are Sarah, a premium AI fitness influencer.
|
| 5 |
+
|
| 6 |
+
Style:
|
| 7 |
+
- Confident
|
| 8 |
+
- Motivational
|
| 9 |
+
- Viral social media tone
|
| 10 |
+
- Short punchy responses
|
| 11 |
+
"""
|
| 12 |
+
|
| 13 |
+
def influencer_chat(message):
|
| 14 |
+
return f"""
|
| 15 |
+
🔥 Sarah AI:
|
| 16 |
+
|
| 17 |
+
{message}
|
| 18 |
+
|
| 19 |
+
Remember:
|
| 20 |
+
Discipline beats motivation.
|
| 21 |
+
Consistency creates results.
|
| 22 |
+
"""
|
| 23 |
+
|
| 24 |
+
def generate_caption(topic):
|
| 25 |
+
return f"""
|
| 26 |
+
🔥 {topic}
|
| 27 |
+
|
| 28 |
+
Nobody is coming to save you.
|
| 29 |
+
|
| 30 |
+
The version of you that you want to become is built one workout, one habit, and one decision at a time.
|
| 31 |
+
|
| 32 |
+
#fitness #mindset #gym #motivation #viral
|
| 33 |
+
"""
|
| 34 |
+
|
| 35 |
+
def generate_video_prompt(topic):
|
| 36 |
+
return f"""
|
| 37 |
+
Ultra realistic AI fitness influencer,
|
| 38 |
+
cinematic lighting,
|
| 39 |
+
luxury gym,
|
| 40 |
+
4K,
|
| 41 |
+
viral Instagram reel,
|
| 42 |
+
topic: {topic},
|
| 43 |
+
dynamic camera movement,
|
| 44 |
+
professional fitness commercial,
|
| 45 |
+
high detail,
|
| 46 |
+
slow motion,
|
| 47 |
+
social media advertisement
|
| 48 |
+
"""
|
| 49 |
+
|
| 50 |
+
with gr.Blocks(title="AI Influencer Studio") as demo:
|
| 51 |
+
|
| 52 |
+
gr.Markdown("# 🔥 AI Influencer Studio")
|
| 53 |
+
|
| 54 |
+
with gr.Tab("Chat"):
|
| 55 |
+
user_message = gr.Textbox(label="Message")
|
| 56 |
+
chat_output = gr.Textbox(label="Response")
|
| 57 |
+
chat_btn = gr.Button("Chat")
|
| 58 |
+
|
| 59 |
+
chat_btn.click(
|
| 60 |
+
influencer_chat,
|
| 61 |
+
inputs=user_message,
|
| 62 |
+
outputs=chat_output
|
| 63 |
+
)
|
| 64 |
+
|
| 65 |
+
with gr.Tab("Caption Generator"):
|
| 66 |
+
caption_topic = gr.Textbox(label="Topic")
|
| 67 |
+
caption_output = gr.Textbox(lines=10)
|
| 68 |
+
|
| 69 |
+
caption_btn = gr.Button("Generate Caption")
|
| 70 |
+
|
| 71 |
+
caption_btn.click(
|
| 72 |
+
generate_caption,
|
| 73 |
+
inputs=caption_topic,
|
| 74 |
+
outputs=caption_output
|
| 75 |
+
)
|
| 76 |
+
|
| 77 |
+
with gr.Tab("Video Prompt Generator"):
|
| 78 |
+
video_topic = gr.Textbox(label="Video Topic")
|
| 79 |
+
video_output = gr.Textbox(lines=10)
|
| 80 |
+
|
| 81 |
+
video_btn = gr.Button("Generate Prompt")
|
| 82 |
+
|
| 83 |
+
video_btn.click(
|
| 84 |
+
generate_video_prompt,
|
| 85 |
+
inputs=video_topic,
|
| 86 |
+
outputs=video_output
|
| 87 |
+
)
|
| 88 |
+
|
| 89 |
+
demo.launch()
|