Update app.py
Browse files
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
|
| 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 |
-
|
| 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.
|
| 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 🕉️",
|