Multiverse26 commited on
Commit
a4c6574
·
verified ·
1 Parent(s): 59fe39b
Files changed (1) hide show
  1. app.py +11 -17
app.py CHANGED
@@ -1,31 +1,25 @@
1
  import gradio as gr
2
  from huggingface_hub import InferenceClient
3
 
4
- client = InferenceClient(model="HuggingFaceH4/zephyr-7b-beta")
5
 
6
  def generate_caption(prompt):
7
- prompt = f"""
8
- Write 3 short, aesthetic Instagram captions for a luxury jewelry product.
9
-
10
- Product: {prompt}
11
-
12
- Style:
13
- - Elegant
14
- - Minimal
15
- - Premium tone
16
- - No long paragraphs
17
-
18
- Output:
19
- """
20
- response = client.text_generation(prompt, max_new_tokens=120)
21
  return response
22
 
23
  iface = gr.Interface(
24
  fn=generate_caption,
25
  inputs=gr.Textbox(placeholder="Enter product (e.g. gold earrings)"),
26
  outputs=gr.Textbox(label="Captions"),
27
- title="✨ AI Luxury Caption Generator",
28
- description="Generate premium captions for your brand"
29
  )
30
 
31
  iface.launch()
 
1
  import gradio as gr
2
  from huggingface_hub import InferenceClient
3
 
4
+ client = InferenceClient(model="tiiuae/falcon-7b-instruct")
5
 
6
  def generate_caption(prompt):
7
+ prompt = f"Write 3 short luxury Instagram captions for: {prompt}"
8
+
9
+ response = client.text_generation(
10
+ prompt,
11
+ max_new_tokens=100,
12
+ temperature=0.7
13
+ )
14
+
 
 
 
 
 
 
15
  return response
16
 
17
  iface = gr.Interface(
18
  fn=generate_caption,
19
  inputs=gr.Textbox(placeholder="Enter product (e.g. gold earrings)"),
20
  outputs=gr.Textbox(label="Captions"),
21
+ title="✨ AI Caption Generator",
22
+ description="Generate clean luxury captions"
23
  )
24
 
25
  iface.launch()