Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -49,16 +49,18 @@ def find_most_similar_command(statement, command_list):
|
|
49 |
|
50 |
return best_match,reply
|
51 |
|
52 |
-
|
|
|
53 |
def send_data_to_db(order_id,col_name):
|
54 |
import requests
|
55 |
|
56 |
# API endpoint URL
|
57 |
-
url = 'https://pizzahut.softinfix.tech/api/save_order/'
|
58 |
|
59 |
# Data to send (in dictionary format)
|
60 |
data = {
|
61 |
col_name: col_value,
|
|
|
62 |
}
|
63 |
|
64 |
# Send POST request with data
|
@@ -82,9 +84,9 @@ def transcribe_the_command(audio,menu_id,order_id):
|
|
82 |
print(menu_id)
|
83 |
|
84 |
transcript = asr_pipe(file_name)["text"]
|
85 |
-
if menu_id
|
86 |
reply=transcript
|
87 |
-
|
88 |
else:
|
89 |
commands=urdu_data[menu_id]
|
90 |
print(commands)
|
|
|
49 |
|
50 |
return best_match,reply
|
51 |
|
52 |
+
transcript_only=[1,3,4]
|
53 |
+
col_value=[1=>"name",3=>"",4=>""]
|
54 |
def send_data_to_db(order_id,col_name):
|
55 |
import requests
|
56 |
|
57 |
# API endpoint URL
|
58 |
+
url = 'https://pizzahut.softinfix.tech/api/save_order/'
|
59 |
|
60 |
# Data to send (in dictionary format)
|
61 |
data = {
|
62 |
col_name: col_value,
|
63 |
+
"order_id":order_id
|
64 |
}
|
65 |
|
66 |
# Send POST request with data
|
|
|
84 |
print(menu_id)
|
85 |
|
86 |
transcript = asr_pipe(file_name)["text"]
|
87 |
+
if menu_id in transcript_only:
|
88 |
reply=transcript
|
89 |
+
send_data_to_db()
|
90 |
else:
|
91 |
commands=urdu_data[menu_id]
|
92 |
print(commands)
|