Anupam251272 commited on
Commit
0182177
·
verified ·
1 Parent(s): 30d2f19

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +248 -304
app.py CHANGED
@@ -1,318 +1,262 @@
1
  import gradio as gr
2
- import pandas as pd
3
- import numpy as np
4
- import random
5
  from datetime import datetime
6
- from scipy import stats
7
- from sklearn.preprocessing import StandardScaler
 
 
 
 
 
 
 
8
 
9
- class AdvancedNumerologyPredictor:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  def __init__(self):
11
- # Comprehensive Numerology Database
12
- self.numerology_database = {
13
- 'life_path_insights': {
14
- 1: {
15
- 'core_energy': 'Leadership and Innovation',
16
- 'elemental_connection': 'Fire',
17
- 'planetary_ruler': 'Sun',
18
- 'compatibility_numbers': [3, 5, 7],
19
- 'spiritual_lesson': 'Learn to lead without dominating',
20
- 'detailed_description': """
21
- Life Path 1 represents the archetype of the pioneer and leader.
22
- Individuals with this path are driven by an innate desire to forge their own path,
23
- create original ideas, and inspire others through their innovative spirit.
24
- You are naturally independent, with a strong will and the courage to overcome obstacles.
25
-
26
- Strengths:
27
- - Natural leadership abilities
28
- - High creativity and originality
29
- - Strong sense of self
30
- - Pioneering spirit
31
-
32
- Challenges:
33
- - Tendency to be overly independent
34
- - Potential for stubbornness
35
- - Learning to collaborate and listen to others
36
- """,
37
- },
38
- 2: {
39
- 'core_energy': 'Cooperation and Sensitivity',
40
- 'elemental_connection': 'Water',
41
- 'planetary_ruler': 'Moon',
42
- 'compatibility_numbers': [4, 6, 9],
43
- 'spiritual_lesson': 'Develop self-worth and boundaries',
44
- 'detailed_description': """
45
- Life Path 2 embodies the energy of cooperation, sensitivity, and emotional intelligence.
46
- You are a natural peacemaker, with an incredible ability to understand and support others.
47
- Your path is about learning to balance your own needs with the needs of those around you.
48
-
49
- Strengths:
50
- - High emotional intelligence
51
- - Exceptional diplomatic skills
52
- - Deep empathy and compassion
53
- - Ability to create harmonious environments
54
-
55
- Challenges:
56
- - Tendency to people-please
57
- - Difficulty setting personal boundaries
58
- - Risk of emotional overwhelm
59
- """
60
- }
61
- # More detailed insights for other numbers can be added similarly
62
- },
63
- 'name_energy_analysis': {
64
- 'vowel_impact': {
65
- 'a': 'Leadership and individuality',
66
- 'e': 'Communication and freedom',
67
- 'i': 'Intuition and inner wisdom',
68
- },
69
- 'consonant_influence': {
70
- 'b': 'Emotional depth',
71
- 'c': 'Creativity and expression',
72
- }
73
- }
74
- }
75
-
76
- # Advanced Prediction Models
77
- self.prediction_models = {
78
- 'love_compatibility_matrix': {
79
- 1: {
80
- 'best_matches': [3, 5],
81
- 'challenging_matches': [4, 8],
82
- 'relationship_dynamics': 'Passionate and independent'
83
- },
84
- 2: {
85
- 'best_matches': [4, 6],
86
- 'challenging_matches': [1, 7],
87
- 'relationship_dynamics': 'Nurturing and supportive'
88
- }
89
- },
90
- 'career_potential_index': {
91
- 1: {
92
- 'innovation_score': 0.9,
93
- 'leadership_potential': 0.95,
94
- 'entrepreneurial_spirit': 0.85
95
- },
96
- 2: {
97
- 'collaboration_score': 0.9,
98
- 'emotional_intelligence': 0.95,
99
- 'supportive_role_potential': 0.85
100
- }
101
- }
102
- }
103
-
104
- def advanced_name_energy_analysis(self, name):
105
- """Perform advanced name energy analysis."""
106
- # Normalize name
107
- name = name.lower().replace(' ', '')
108
-
109
- # Vowel and consonant analysis
110
- vowels = [char for char in name if char in 'aeiou']
111
- consonants = [char for char in name if char not in 'aeiou']
112
-
113
- # Calculate name energy scores
114
- vowel_energy = sum(ord(v) for v in vowels) / len(vowels) if vowels else 0
115
- consonant_energy = sum(ord(c) for c in consonants) / len(consonants) if consonants else 0
116
-
117
- return {
118
- 'vowel_analysis': {
119
- 'count': len(vowels),
120
- 'energy_score': vowel_energy,
121
- 'dominant_vowel_impact': self.numerology_database['name_energy_analysis']['vowel_impact'].get(
122
- max(set(vowels), key=vowels.count), 'Unique energy'
123
- )
124
- },
125
- 'consonant_analysis': {
126
- 'count': len(consonants),
127
- 'energy_score': consonant_energy,
128
- 'dominant_consonant_influence': self.numerology_database['name_energy_analysis']['consonant_influence'].get(
129
- max(set(consonants), key=consonants.count), 'Distinctive influence'
130
- )
131
- }
132
- }
133
-
134
- def generate_quantum_prediction(self, life_path, name, dob):
135
- """Generate a multi-dimensional predictive analysis with detailed explanations."""
136
- # Name energy analysis
137
- name_energy = self.advanced_name_energy_analysis(name)
138
-
139
- # Life path insights
140
- life_path_insights = self.numerology_database['life_path_insights'].get(
141
- life_path,
142
- {
143
- 'core_energy': 'Unique Path',
144
- 'spiritual_lesson': 'Embrace your individuality',
145
- 'detailed_description': 'Your life path is a unique journey of personal discovery and growth.'
146
- }
147
- )
148
 
149
- # Love and career compatibility
150
- love_compatibility = self.prediction_models['love_compatibility_matrix'].get(life_path, {})
151
- career_potential = self.prediction_models['career_potential_index'].get(life_path, {})
152
-
153
- # Generate probabilistic future scenarios
154
- future_scenarios = self._generate_future_scenarios(life_path)
155
-
156
- # Comprehensive prediction with enhanced explanations
157
- prediction = f"""
158
- 🌟 QUANTUM NUMEROLOGY PROFILE: {name.title()}
159
- =======================================
160
-
161
- 🔢 LIFE PATH QUANTUM SIGNATURE
162
- ------------------------------
163
- Life Path Number: {life_path}
164
- Core Energy: {life_path_insights['core_energy']}
165
- Elemental Connection: {life_path_insights.get('elemental_connection', 'Undefined')}
166
- Planetary Ruler: {life_path_insights.get('planetary_ruler', 'Uncharted')}
167
-
168
- 🌈 LIFE PATH UNDERSTANDING
169
- --------------------------
170
- {life_path_insights.get('detailed_description', 'Your unique life path offers a profound journey of personal growth.')}
171
-
172
- 🧬 NAME ENERGY QUANTUM ANALYSIS
173
- -------------------------------
174
- Your name carries a unique vibrational energy that influences your personal journey.
175
-
176
- Vowel Energy:
177
- • Count: {name_energy['vowel_analysis']['count']}
178
- • Energy Score: {name_energy['vowel_analysis']['energy_score']:.2f}
179
- • Dominant Vowel Impact: {name_energy['vowel_analysis']['dominant_vowel_impact']}
180
- Interpretation: The vowels in your name reflect your inner emotional landscape
181
- and how you express your deeper feelings and motivations.
182
-
183
- Consonant Energy:
184
- • Count: {name_energy['consonant_analysis']['count']}
185
- • Energy Score: {name_energy['consonant_analysis']['energy_score']:.2f}
186
- • Dominant Consonant Influence: {name_energy['consonant_analysis']['dominant_consonant_influence']}
187
- Interpretation: The consonants in your name represent your external personality,
188
- communication style, and how you interact with the world.
189
-
190
- ❤️ QUANTUM LOVE COMPATIBILITY
191
- -----------------------------
192
- Your numerological profile offers insights into potential relationship dynamics:
193
-
194
- Best Romantic Matches: {love_compatibility.get('best_matches', 'Exploring')}
195
- These life path numbers naturally resonate with your energy,
196
- creating harmonious and supportive connections.
197
-
198
- Challenging Matches: {love_compatibility.get('challenging_matches', 'Navigating')}
199
- These relationships offer opportunities for growth,
200
- requiring more conscious communication and understanding.
201
-
202
- Relationship Dynamics: {love_compatibility.get('relationship_dynamics', 'Complex Interactions')}
203
- Your unique energy creates intricate and transformative relationships
204
- that challenge and support your personal evolution.
205
-
206
- 💼 CAREER QUANTUM POTENTIAL
207
- ---------------------------
208
- Your numerological blueprint reveals unique professional strengths:
209
-
210
- Innovation Potential: {career_potential.get('innovation_score', 0):.2f}/1.00
211
- Your ability to think creatively and develop groundbreaking ideas.
212
-
213
- Leadership Capacity: {career_potential.get('leadership_potential', 0):.2f}/1.00
214
- Your natural ability to guide, inspire, and motivate others.
215
-
216
- Entrepreneurial Spirit: {career_potential.get('entrepreneurial_spirit', 0):.2f}/1.00
217
- Your drive to create, initiate, and transform professional landscapes.
218
-
219
- 🌈 FUTURE QUANTUM SCENARIOS
220
- ---------------------------
221
- Potential Pathways of Growth:
222
- {chr(10).join(f"• {scenario}" for scenario in future_scenarios)}
223
-
224
- These scenarios represent potential energetic alignments and opportunities.
225
- Remember, they are possibilities, not fixed predictions.
226
-
227
- 🔮 SPIRITUAL QUANTUM LESSON
228
- ---------------------------
229
- {life_path_insights.get('spiritual_lesson', 'Continuous Evolution')}
230
-
231
- This is the core learning that will help you grow, transform, and align
232
- with your highest potential.
233
-
234
- UNIVERSAL GUIDANCE:
235
- -------------------
236
- Your numerological profile is a quantum blueprint of potential.
237
- It's not a deterministic map, but a vibrational guide to understanding
238
- your inherent strengths, challenges, and evolutionary path.
239
-
240
- Embrace your unique journey. Your numbers illuminate the path,
241
- but you are the creator of your destiny.
242
-
243
- Quantum wisdom awaits your conscious exploration! 🌠
244
- """
245
- return prediction
246
-
247
- def _generate_future_scenarios(self, life_path):
248
- """Generate probabilistic future scenarios."""
249
- current_year = datetime.now().year
250
- scenarios = [
251
- f"{current_year}: Potential breakthrough in personal development",
252
- f"{current_year+1}: Opportunity for significant transformation",
253
- f"{current_year+2}: Alignment of personal and professional goals"
254
  ]
255
 
256
- # Add some randomness and life path-specific scenarios
257
- life_path_specific_scenarios = {
258
- 1: [
259
- "Emerging leadership opportunities",
260
- "Breakthrough in innovative projects"
261
- ],
262
- 2: [
263
- "Deep emotional healing",
264
- "Strengthening of important relationships"
265
- ]
266
- }
267
-
268
- scenarios.extend(
269
- life_path_specific_scenarios.get(life_path, [
270
- "Unique path of personal discovery"
271
- ])
272
- )
273
 
274
- return scenarios
 
 
 
275
 
276
- # Numerology Calculation Functions
277
- def calculate_life_path_number(dob):
278
- """Calculate Life Path Number from date of birth."""
279
- dob_digits = [int(d) for d in dob.replace('-', '').replace('/', '')]
280
- total_sum = sum(dob_digits)
281
- while total_sum > 9:
282
- total_sum = sum(int(digit) for digit in str(total_sum))
283
- return total_sum
284
 
285
- # Initialize Advanced Predictor
286
- quantum_predictor = AdvancedNumerologyPredictor()
 
 
287
 
288
- # Gradio Interface Function
289
- def quantum_numerology_agent(name, dob):
290
- """Main function to process quantum numerology predictions."""
291
- try:
292
- # Calculate Life Path Number
293
- life_path_number = calculate_life_path_number(dob)
 
 
 
 
 
 
 
 
 
294
 
295
- # Generate Comprehensive Quantum Prediction
296
- prediction = quantum_predictor.generate_quantum_prediction(
297
- life_path_number, name, dob
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
298
  )
299
 
300
- return prediction
301
-
302
- except Exception as e:
303
- return f"Error in quantum prediction: {str(e)}"
304
-
305
- # Create Gradio Interface
306
- interface = gr.Interface(
307
- fn=quantum_numerology_agent,
308
- inputs=[
309
- gr.Textbox(label="Full Name", placeholder="Enter your full name"),
310
- gr.Textbox(label="Date of Birth (YYYY-MM-DD)", placeholder="e.g., 1990-05-15")
311
- ],
312
- outputs=gr.Textbox(label="Quantum Numerology Profile"),
313
- title="🌌 Quantum Numerology Insight Generator",
314
- description="Unlock the quantum potential of your numerological blueprint! Discover profound insights into your life path, energy, and potential."
315
- )
316
-
317
- # Launch the interface
318
- interface.launch(debug=True)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
+ from dataclasses import dataclass
 
 
3
  from datetime import datetime
4
+ from typing import Dict, List, Optional, Tuple
5
+ import requests
6
+ from astral import LocationInfo
7
+ from astral.sun import sun
8
+ import os
9
+ from enum import Enum
10
+ import logging
11
+ import re
12
+ import random
13
 
14
+ # Configure logging
15
+ logging.basicConfig(level=logging.INFO)
16
+ logger = logging.getLogger(__name__)
17
+
18
+ @dataclass
19
+ class YearlyPrediction:
20
+ year: int
21
+ theme: str
22
+ career: Dict[str, str]
23
+ love: Dict[str, str]
24
+ health: Dict[str, str]
25
+ growth_potential: float
26
+ harmony_level: float
27
+ vitality_level: float
28
+
29
+ class PredictionThemes(Enum):
30
+ ABUNDANCE = "ABUNDANCE"
31
+ TRANSFORMATION = "TRANSFORMATION"
32
+ GROWTH = "GROWTH"
33
+ MANIFESTATION = "MANIFESTATION"
34
+
35
+ @dataclass
36
+ class LocationDetails:
37
+ latitude: float
38
+ longitude: float
39
+ timezone: str
40
+ city: str
41
+ country: str
42
+
43
+ class PredictionDatabase:
44
+ """Enhanced prediction database with more detailed data."""
45
+
46
  def __init__(self):
47
+ self._initialize_databases()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
48
 
49
+ def _initialize_databases(self):
50
+ self.focus_areas = [
51
+ "Technology", "Politics", "Sports", "Business", "Education",
52
+ "Arts", "Science", "Healthcare", "Finance", "Media"
53
+ ]
54
+
55
+ self.opportunities = [
56
+ "Lead major initiative", "Career advancement",
57
+ "Start new venture", "Launch innovative project"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
  ]
59
 
60
+ self.love_developments = [
61
+ "Meaningful commitment", "Deeper emotional connection",
62
+ "Exciting shared adventures", "Strong emotional bonds"
63
+ ]
 
 
 
 
 
 
 
 
 
 
 
 
 
64
 
65
+ self.activities = [
66
+ "Creative Projects", "Travel", "Sports",
67
+ "Cultural Events", "Social Gatherings"
68
+ ]
69
 
70
+ self.health_focuses = [
71
+ "Active lifestyle habits", "Regular exercise routine",
72
+ "Stress-relief techniques", "Balanced nutrition"
73
+ ]
 
 
 
 
74
 
75
+ self.health_practices = [
76
+ "Leadership Roles", "High-Intensity Training",
77
+ "Mindfulness Practice", "Team Sports"
78
+ ]
79
 
80
+ class PredictionGenerator:
81
+ """Enhanced prediction generator with detailed formatting."""
82
+
83
+ def __init__(self):
84
+ self.db = PredictionDatabase()
85
+
86
+ def generate_five_year_prediction(self, name: str, start_year: int,
87
+ birth_time: str, location: LocationDetails) -> str:
88
+ predictions = []
89
+ for year in range(start_year, start_year + 5):
90
+ predictions.append(self._generate_yearly_prediction(year))
91
+
92
+ return self._format_comprehensive_prediction(
93
+ name, birth_time, location, predictions
94
+ )
95
 
96
+ def _generate_yearly_prediction(self, year: int) -> YearlyPrediction:
97
+ """Generate detailed prediction for a specific year."""
98
+ return YearlyPrediction(
99
+ year=year,
100
+ theme=random.choice(list(PredictionThemes)).value,
101
+ career={
102
+ "focus_area": random.choice(self.db.focus_areas),
103
+ "opportunity": random.choice(self.db.opportunities),
104
+ "peak_months": ", ".join(sorted(random.sample([
105
+ "January", "February", "March", "April", "May", "June",
106
+ "July", "August", "September", "October", "November", "December"
107
+ ], 3)))
108
+ },
109
+ love={
110
+ "development": random.choice(self.db.love_developments),
111
+ "activity": random.choice(self.db.activities),
112
+ "peak_months": ", ".join(sorted(random.sample([
113
+ "January", "February", "March", "April", "May", "June",
114
+ "July", "August", "September", "October", "November", "December"
115
+ ], 2)))
116
+ },
117
+ health={
118
+ "focus": random.choice(self.db.health_focuses),
119
+ "practice": random.choice(self.db.health_practices),
120
+ "peak_months": ", ".join(sorted(random.sample([
121
+ "January", "February", "March", "April", "May", "June",
122
+ "July", "August", "September", "October", "November", "December"
123
+ ], 3)))
124
+ },
125
+ growth_potential=random.uniform(80, 98),
126
+ harmony_level=random.uniform(80, 99),
127
+ vitality_level=random.uniform(85, 97)
128
  )
129
 
130
+ def _format_comprehensive_prediction(self, name: str, birth_time: str,
131
+ location: LocationDetails,
132
+ predictions: List[YearlyPrediction]) -> str:
133
+ """Format the comprehensive prediction with all details."""
134
+ output = f"""🌟 COMPREHENSIVE LIFE PATH PREDICTION FOR {name.upper()} 🌟
135
+ =========================================================
136
+
137
+ 📊 CORE NUMEROLOGICAL PROFILE
138
+ ----------------------------
139
+ Birth Time: {birth_time}
140
+ Location: {location.city} ({location.country})
141
+
142
+ 🔮 5-YEAR LIFE FORECAST (Year by Year Analysis)
143
+ ---------------------------------------------
144
+
145
+ """
146
+ # Add yearly predictions
147
+ for pred in predictions:
148
+ output += f"""
149
+ {pred.year} - YEAR OF {pred.theme}
150
+ -------------------------------------------------------------------
151
+
152
+ 💼 Career Path:
153
+ • Focus Area: {pred.career['focus_area']}
154
+ • Key Opportunity: {pred.career['opportunity']}
155
+ • Peak Months: {pred.career['peak_months']}
156
+ • Growth Potential: {pred.growth_potential:.1f}%
157
+
158
+ ❤️ Love & Relationships:
159
+ • Key Development: {pred.love['development']}
160
+ • Recommended Activity: {pred.love['activity']}
161
+ • Romantic Peaks: {pred.love['peak_months']}
162
+ • Harmony Level: {pred.harmony_level:.1f}%
163
+
164
+ 🌿 Health & Wellness:
165
+ • Focus Area: {pred.health['focus']}
166
+ • Recommended Practice: {pred.health['practice']}
167
+ • Peak Vitality Months: {pred.health['peak_months']}
168
+ • Vitality Level: {pred.vitality_level:.1f}%
169
+ """
170
+
171
+ # Add final sections
172
+ output += """
173
+ 🌈 INTEGRATED LIFE HARMONY ANALYSIS
174
+ ---------------------------------
175
+ Your numbers reveal a beautiful synchronicity between career growth,
176
+ personal relationships, and health developments. Each aspect supports
177
+ and enhances the others, creating a harmonious life trajectory.
178
+
179
+ Key Integration Points:
180
+ • Career achievements positively impact relationship confidence
181
+ • Relationship growth supports emotional and physical well-being
182
+ • Health improvements boost career performance and relationship energy
183
+
184
+ 💫 GUIDANCE FOR OPTIMAL GROWTH
185
+ ----------------------------
186
+ 1. Embrace each opportunity for growth across all life areas
187
+ 2. Maintain balance between professional ambitions and personal life
188
+ 3. Practice self-care to sustain energy for both career and relationships
189
+ 4. Trust your intuition in making life decisions
190
+ 5. Stay open to unexpected opportunities and connections
191
+
192
+ 🌟 FINAL WISDOM
193
+ --------------
194
+ This five-year period shows exceptional promise for personal growth,
195
+ professional achievement, and meaningful relationships. Your unique
196
+ numerical vibration suggests a time of positive transformation and
197
+ fulfilling experiences across all life areas."""
198
+
199
+ return output
200
+
201
+ def create_gradio_interface() -> gr.Interface:
202
+ """Create and configure the Gradio interface."""
203
+
204
+ def predict(name: str, dob: str, birth_time: str, birth_place: str) -> str:
205
+ """Main prediction function for Gradio interface."""
206
+ try:
207
+ # Validate inputs
208
+ error = validate_inputs(name, dob, birth_time, birth_place)
209
+ if error:
210
+ return error
211
+
212
+ # Create location details (simplified for example)
213
+ location = LocationDetails(
214
+ latitude=27.6094, # Example coordinates for Sikar
215
+ longitude=75.1398,
216
+ timezone="Asia/Kolkata",
217
+ city=birth_place.split(',')[0].strip(),
218
+ country="India" if "India" in birth_place else "Unknown"
219
+ )
220
+
221
+ # Generate prediction
222
+ generator = PredictionGenerator()
223
+ current_year = datetime.now().year
224
+ prediction = generator.generate_five_year_prediction(
225
+ name, current_year, birth_time, location
226
+ )
227
+
228
+ return prediction
229
+ except Exception as e:
230
+ logger.error(f"Error in prediction: {e}")
231
+ return f"An error occurred: {str(e)}"
232
+
233
+ return gr.Interface(
234
+ fn=predict,
235
+ inputs=[
236
+ gr.Textbox(label="Full Name", placeholder="Enter your full name"),
237
+ gr.Textbox(label="Date of Birth (YYYY-MM-DD)", placeholder="e.g., 1990-05-15"),
238
+ gr.Textbox(label="Birth Time (HH:MM)", placeholder="e.g., 14:30"),
239
+ gr.Textbox(label="Birth Place", placeholder="e.g., Sikar, Rajasthan, India")
240
+ ],
241
+ outputs=gr.Textbox(label="Your Comprehensive Life Path Prediction"),
242
+ title="🌟 Quantum Life Path Prediction System",
243
+ description="Discover your quantum numerological blueprint!"
244
+ )
245
+
246
+ def validate_inputs(name: str, dob: str, birth_time: str, birth_place: str) -> Optional[str]:
247
+ """Validate all input parameters."""
248
+ if not all([name, dob, birth_time, birth_place]):
249
+ return "All fields are required."
250
+ if not name.strip():
251
+ return "Name cannot be empty."
252
+ if not re.match(r"^\d{2}:\d{2}$", birth_time):
253
+ return "Invalid time format. Use HH:MM."
254
+ try:
255
+ datetime.strptime(dob, "%Y-%m-%d")
256
+ except ValueError:
257
+ return "Invalid date format. Use YYYY-MM-DD."
258
+ return None
259
+
260
+ if __name__ == "__main__":
261
+ interface = create_gradio_interface()
262
+ interface.launch(debug=True)