selfit-camera commited on
Commit
c363b80
Β·
1 Parent(s): cb9a662
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -137,8 +137,8 @@ def generate_trump_voice_with_realtime_updates(text, language_display, request:
137
  if not text or len(text.strip()) < 3:
138
  return "Text too short, please enter at least 3 characters", None, gr.update(visible=False), ""
139
 
140
- if len(text.strip()) > 1000:
141
- msg = "Text too long (maximum 1000 characters). Please visit our official website for longer text generation."
142
  # Create "Go to Official Website" button HTML
143
  go_to_website_html = f"""
144
  <div style='display: flex; justify-content: center; gap: 30px; margin: 10px 0 25px 0; padding: 0px;'>
@@ -158,7 +158,7 @@ def generate_trump_voice_with_realtime_updates(text, language_display, request:
158
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
159
  transition: all 0.3s ease;
160
  border: none;
161
- '>🌐 Go to Official Website</a>
162
  </div>
163
  """
164
  yield msg, None, gr.update(value=go_to_website_html, visible=True), ""
@@ -292,7 +292,7 @@ with gr.Blocks(title="Donald Trump AI Voice", theme=gr.themes.Soft()) as demo:
292
  text_input = gr.Textbox(
293
  label="πŸ“ Input Text",
294
  lines=4,
295
- max_length=1000,
296
  placeholder="Enter what you want Trump to say...",
297
  value="Hello everyone, this is a demonstration of the Trump AI Voice system with real-time status monitoring."
298
  )
 
137
  if not text or len(text.strip()) < 3:
138
  return "Text too short, please enter at least 3 characters", None, gr.update(visible=False), ""
139
 
140
+ if len(text.strip()) >= 1800:
141
+ msg = "⚠️ This space has a maximum limit of 2000 characters. Please visit our official website to generate longer content for free."
142
  # Create "Go to Official Website" button HTML
143
  go_to_website_html = f"""
144
  <div style='display: flex; justify-content: center; gap: 30px; margin: 10px 0 25px 0; padding: 0px;'>
 
158
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
159
  transition: all 0.3s ease;
160
  border: none;
161
+ '>🌐 Go to Official Website for Free</a>
162
  </div>
163
  """
164
  yield msg, None, gr.update(value=go_to_website_html, visible=True), ""
 
292
  text_input = gr.Textbox(
293
  label="πŸ“ Input Text",
294
  lines=4,
295
+ max_length=2000,
296
  placeholder="Enter what you want Trump to say...",
297
  value="Hello everyone, this is a demonstration of the Trump AI Voice system with real-time status monitoring."
298
  )