Spaces:
Sleeping
Sleeping
Fixed error
Browse files
app.py
CHANGED
@@ -58,6 +58,10 @@ def extract_images():
|
|
58 |
return json.dumps({"images":img_urls})
|
59 |
except Exception as e:
|
60 |
return e
|
|
|
|
|
|
|
|
|
61 |
|
62 |
# @app.route("/predict", methods=["GET"])
|
63 |
# def predict():
|
@@ -94,9 +98,6 @@ def extract_images():
|
|
94 |
|
95 |
@app.route('/answer',methods=['POST'])
|
96 |
def answer():
|
97 |
-
api_key=os.getenv("GOOGLE_API_KEY")
|
98 |
-
genai.configure(api_key=api_key)
|
99 |
-
model=genai.GenerativeModel('gemini-pro')
|
100 |
query=request.get_json()['query']
|
101 |
final_query=f"""
|
102 |
Following are negative reviews about my products, suggest what are the key issues from the customer feedback:{query}
|
|
|
58 |
return json.dumps({"images":img_urls})
|
59 |
except Exception as e:
|
60 |
return e
|
61 |
+
|
62 |
+
api_key=os.getenv("GOOGLE_API_KEY")
|
63 |
+
genai.configure(api_key=api_key)
|
64 |
+
model=genai.GenerativeModel('gemini-pro')
|
65 |
|
66 |
# @app.route("/predict", methods=["GET"])
|
67 |
# def predict():
|
|
|
98 |
|
99 |
@app.route('/answer',methods=['POST'])
|
100 |
def answer():
|
|
|
|
|
|
|
101 |
query=request.get_json()['query']
|
102 |
final_query=f"""
|
103 |
Following are negative reviews about my products, suggest what are the key issues from the customer feedback:{query}
|