arpit13 commited on
Commit
44dc108
·
verified ·
1 Parent(s): 5479dc7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +15 -27
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
- readable_response = f"""
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. Please check input values."
34
  else:
35
- return f"Error fetching data: {response.status_code}"
36
 
37
  with gr.Blocks() as demo:
38
- gr.Markdown("# Mangal Dosh Checker 🪐")
39
- gr.Markdown("Enter your details to check for Mangal Dosh:")
 
 
 
 
40
 
41
- name = gr.Textbox(label="Name")
42
- dob = gr.Textbox(label="Date of Birth (DD/MM/YYYY)")
43
- tob = gr.Textbox(label="Time of Birth (HH:MM)")
44
- lat = gr.Number(label="Latitude")
45
- lon = gr.Number(label="Longitude")
46
- tz = gr.Number(label="Time Zone (e.g., 5.5)")
47
 
48
- submit_btn = gr.Button("Check Mangal Dosh")
49
- result = gr.Markdown()
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