Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -63,21 +63,13 @@ def is_query_about_cashback(query):
|
|
63 |
return any(word.lower() in query.lower() for word in cashback_keywords)
|
64 |
|
65 |
def ask_ai(query):
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
local_transactions = float(input("Enter your local transactions amount: "))
|
72 |
-
|
73 |
-
cashback = cashback_calculator(segment, total_spent, international_transactions, local_transactions)
|
74 |
-
return f"The cashback amount for your card is: {cashback:.2f}"
|
75 |
-
else:
|
76 |
-
index = GPTSimpleVectorIndex.load_from_disk('index.json')
|
77 |
-
response = index.query(query, response_mode="compact")
|
78 |
-
return response.response
|
79 |
-
iface = gr.Interface(fn=ask_ai, inputs=["text", "text", "number", "number", "number"], outputs="text", title="The following is a conversation with a human called Shegardi. Shegardi is helpful, precise, truthful, and very friendly. Also, Shegardi is an employee of Warba Bank, located in Kuwait. Shegardi will only use the information provided to him.",
|
80 |
description="Enter a question and get an answer from Shegardi.")
|
|
|
81 |
iface.launch()
|
82 |
|
83 |
|
|
|
63 |
return any(word.lower() in query.lower() for word in cashback_keywords)
|
64 |
|
65 |
def ask_ai(query):
|
66 |
+
index = GPTSimpleVectorIndex.load_from_disk('index.json')
|
67 |
+
response = index.query(query, response_mode="compact")
|
68 |
+
return response.response
|
69 |
+
|
70 |
+
iface = gr.Interface(fn=ask_ai, inputs="text", outputs="text", title="The following is a conversation with a human called Shegardi. Shegardi is helpful, precise, truthful, and very friendly. Also, Shegardi is an employee of Warba Bank, located in Kuwait. Shegardi will only use the information provided to him. ",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
description="Enter a question and get an answer from Shegardi.")
|
72 |
+
|
73 |
iface.launch()
|
74 |
|
75 |
|