arpit13 commited on
Commit
47e0838
·
verified ·
1 Parent(s): 0e872b0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -3
app.py CHANGED
@@ -49,7 +49,23 @@ def check_dasha(dasha_type, name, dob, tob, lat, lon, tz):
49
  if isinstance(response, str):
50
  return response
51
 
52
- return f"### {dasha_type.replace('-', ' ').title()} Analysis for {name}\n\n" + str(response)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53
 
54
  # Gradio UI with improvements
55
  with gr.Blocks(theme=gr.themes.Soft()) as demo:
@@ -58,12 +74,12 @@ with gr.Blocks(theme=gr.themes.Soft()) as demo:
58
  with gr.Row():
59
  name = gr.Textbox(label="Name", placeholder="Enter your name")
60
  dob = gr.Textbox(label="DOB (DD/MM/YYYY)", placeholder="21/04/2021")
61
- tob = gr.Textbox(label="Time (HH:MM)", placeholder="11:40")
62
 
63
  with gr.Row():
64
  lat = gr.Number(label="Latitude", value=11)
65
  lon = gr.Number(label="Longitude", value=77)
66
- tz = gr.Number(label="Time Zone", value=5.5)
67
 
68
  result = gr.Markdown()
69
 
 
49
  if isinstance(response, str):
50
  return response
51
 
52
+ # Format the dasha data to make it more readable
53
+ analysis = response.get("analysis", [])
54
+ period = response.get("period", "N/A")
55
+ dasha_details = "\n".join([f"- {item}" for item in analysis])
56
+
57
+ readable_response = f"""
58
+ ### {dasha_type.replace('-', ' ').title()} Analysis for {name}
59
+
60
+ **Period:** {period}
61
+
62
+ **Detailed Dasha Analysis:**
63
+ {dasha_details}
64
+
65
+ **Astrological Suggestions:**
66
+ - Follow the guidance based on your dasha period.
67
+ """
68
+ return readable_response
69
 
70
  # Gradio UI with improvements
71
  with gr.Blocks(theme=gr.themes.Soft()) as demo:
 
74
  with gr.Row():
75
  name = gr.Textbox(label="Name", placeholder="Enter your name")
76
  dob = gr.Textbox(label="DOB (DD/MM/YYYY)", placeholder="21/04/2021")
77
+ tob = gr.Textbox(label="Time of Birth (HH:MM)", placeholder="11:40")
78
 
79
  with gr.Row():
80
  lat = gr.Number(label="Latitude", value=11)
81
  lon = gr.Number(label="Longitude", value=77)
82
+ tz = gr.Number(label="Timezone (e.g., 5.5 for India)", value=5.5)
83
 
84
  result = gr.Markdown()
85