Rishit commited on
Commit
66e0ab6
·
verified ·
1 Parent(s): 5044852

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -6
app.py CHANGED
@@ -37,7 +37,7 @@ import requests
37
 
38
  API_URL = "https://ai-research.quarkgen.ai/templedekho/vastu/v1"
39
 
40
- def get_vastu_advice(question, image_path=None, pdf_path=None):
41
  """
42
  Get Vastu advice by sending a question and either an image or PDF to the API.
43
  """
@@ -48,9 +48,9 @@ def get_vastu_advice(question, image_path=None, pdf_path=None):
48
  if image_path:
49
  files['image_path'] = open(image_path, 'rb')
50
 
51
- # Add PDF file if provided
52
- if pdf_path:
53
- files['image_path'] = open(image_path, 'rb')
54
 
55
  try:
56
  response = requests.post(API_URL, files=files, data=data)
@@ -71,8 +71,7 @@ iface = gr.Interface(
71
  fn=get_vastu_advice,
72
  inputs=[
73
  gr.Textbox(label="Question"),
74
- gr.Image(type="filepath", label="Upload House Image (JPEG/PNG)"),
75
- gr.File(type="filepath", label="Upload House Blueprint (PDF)")
76
  ],
77
  outputs=gr.Textbox(label="Vastu Prediction"),
78
  title="🕉️ AI Vastu Astrologer 🕉️",
 
37
 
38
  API_URL = "https://ai-research.quarkgen.ai/templedekho/vastu/v1"
39
 
40
+ def get_vastu_advice(question, image_path=None):
41
  """
42
  Get Vastu advice by sending a question and either an image or PDF to the API.
43
  """
 
48
  if image_path:
49
  files['image_path'] = open(image_path, 'rb')
50
 
51
+ # # Add PDF file if provided
52
+ # if pdf_path:
53
+ # files['image_path'] = open(image_path, 'rb')
54
 
55
  try:
56
  response = requests.post(API_URL, files=files, data=data)
 
71
  fn=get_vastu_advice,
72
  inputs=[
73
  gr.Textbox(label="Question"),
74
+ gr.File(type="filepath", label="Upload House Image (JPEG/PNG/PDF)"),
 
75
  ],
76
  outputs=gr.Textbox(label="Vastu Prediction"),
77
  title="🕉️ AI Vastu Astrologer 🕉️",