Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -14,39 +14,27 @@ def check_mangal_dosh(name, dob, tob, lat, lon, tz):
|
|
14 |
bot_response = data["response"].get("bot_response", "No information available")
|
15 |
score = data["response"].get("score", "N/A")
|
16 |
|
17 |
-
|
18 |
-
**Mangal Dosh Analysis for {name}:**
|
19 |
-
|
20 |
-
**Dosha Presence:** {'Yes' if dosha_present else 'No'}
|
21 |
-
**Score:** {score}%
|
22 |
-
|
23 |
-
**Detailed Analysis:**
|
24 |
-
- **Moon Influence:** {factors.get('moon', 'Not mentioned')}
|
25 |
-
- **Saturn Influence:** {factors.get('saturn', 'Not mentioned')}
|
26 |
-
- **Rahu Influence:** {factors.get('rahu', 'Not mentioned')}
|
27 |
-
|
28 |
-
**Astrological Suggestion:** {bot_response}
|
29 |
-
|
30 |
-
"""
|
31 |
-
return readable_response
|
32 |
else:
|
33 |
-
return "Invalid response from API.
|
34 |
else:
|
35 |
-
return
|
36 |
|
37 |
with gr.Blocks() as demo:
|
38 |
-
gr.Markdown("
|
39 |
-
|
|
|
|
|
|
|
|
|
40 |
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
lon = gr.Number(label="Longitude")
|
46 |
-
tz = gr.Number(label="Time Zone (e.g., 5.5)")
|
47 |
|
48 |
-
submit_btn = gr.Button("Check
|
49 |
-
result = gr.
|
50 |
|
51 |
submit_btn.click(check_mangal_dosh, inputs=[name, dob, tob, lat, lon, tz], outputs=result)
|
52 |
|
|
|
14 |
bot_response = data["response"].get("bot_response", "No information available")
|
15 |
score = data["response"].get("score", "N/A")
|
16 |
|
17 |
+
return f"Mangal Dosh: {'Yes' if dosha_present else 'No'}\nScore: {score}%\n{bot_response}"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
else:
|
19 |
+
return "Invalid response from API."
|
20 |
else:
|
21 |
+
return "Error fetching data."
|
22 |
|
23 |
with gr.Blocks() as demo:
|
24 |
+
gr.Markdown("## Mangal Dosh Checker")
|
25 |
+
|
26 |
+
with gr.Row():
|
27 |
+
name = gr.Textbox(label="Name")
|
28 |
+
dob = gr.Textbox(label="DOB (DD/MM/YYYY)")
|
29 |
+
tob = gr.Textbox(label="Time (HH:MM)")
|
30 |
|
31 |
+
with gr.Row():
|
32 |
+
lat = gr.Number(label="Latitude")
|
33 |
+
lon = gr.Number(label="Longitude")
|
34 |
+
tz = gr.Number(label="Time Zone")
|
|
|
|
|
35 |
|
36 |
+
submit_btn = gr.Button("Check")
|
37 |
+
result = gr.Textbox()
|
38 |
|
39 |
submit_btn.click(check_mangal_dosh, inputs=[name, dob, tob, lat, lon, tz], outputs=result)
|
40 |
|