dominguezdaniel commited on
Commit
248791d
·
verified ·
1 Parent(s): edfae38

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -7
app.py CHANGED
@@ -1,21 +1,21 @@
1
  from transformers import pipeline
2
  import gradio as gr
3
 
 
4
  pipe = pipeline("text-generation", model="deepseek-ai/DeepSeek-V3-0324", trust_remote_code=True)
5
- pipe(messages)
6
 
7
  def generate_description(business_name):
8
  prompt = (
9
- f"Write a complete Google My Business description for a business called '{business_name}'. "
10
-
11
  )
12
- result = pipe(prompt, max_new_tokens=700, temperature=0.5)
13
  return result[0]['generated_text'].strip()
14
 
15
  gr.Interface(
16
  fn=generate_description,
17
  inputs=gr.Textbox(label="Business Name", placeholder="e.g. Pizza House"),
18
  outputs="text",
19
- title="GMB Description Generator.",
20
- description="Generate SEO-optimized Google My Business descriptions using FLAN-T5."
21
- ).launch()
 
1
  from transformers import pipeline
2
  import gradio as gr
3
 
4
+ # Ensure accelerate is installed: pip install accelerate
5
  pipe = pipeline("text-generation", model="deepseek-ai/DeepSeek-V3-0324", trust_remote_code=True)
 
6
 
7
  def generate_description(business_name):
8
  prompt = (
9
+ f"Write a complete, commercial and SEO-optimized Google My Business description for a business called '{business_name}'. "
10
+ "Highlight services, quality, trust, and key features in under 250 characters."
11
  )
12
+ result = pipe(prompt, max_new_tokens=250, temperature=0.7)
13
  return result[0]['generated_text'].strip()
14
 
15
  gr.Interface(
16
  fn=generate_description,
17
  inputs=gr.Textbox(label="Business Name", placeholder="e.g. Pizza House"),
18
  outputs="text",
19
+ title="GMB Description Generator",
20
+ description="Generate SEO-optimized Google My Business descriptions using DeepSeek."
21
+ ).launch()