Spaces:
Runtime error
Runtime error
Commit
·
584ba32
1
Parent(s):
1de54db
correct defect of filechek
Browse files
app.py
CHANGED
@@ -1583,6 +1583,7 @@ def clearall():
|
|
1583 |
|
1584 |
def retry(history3):
|
1585 |
global last_request
|
|
|
1586 |
print("last_request", last_request)
|
1587 |
message = last_request
|
1588 |
history3 = history3 + [(message, None)]
|
@@ -1601,11 +1602,21 @@ def retry(history3):
|
|
1601 |
# real_content = response[-1:]
|
1602 |
# print("real_content", real_content)
|
1603 |
try:
|
1604 |
-
temp = response.split("(sandbox:/")[1] # (sandbox:/sample-20230805-0807.wav)
|
1605 |
-
file_name = temp.split(")")[0]
|
1606 |
-
print("file_name:", file_name)
|
1607 |
-
history3 = history3 + [(None, (file_name,))]
|
1608 |
-
yield history3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1609 |
except:
|
1610 |
print("No need to add file in chatbot")
|
1611 |
|
@@ -1740,12 +1751,20 @@ def SingleTalk(WavFile, history5):
|
|
1740 |
# real_content = response[-1:]
|
1741 |
# print("real_content", real_content)
|
1742 |
try:
|
1743 |
-
file_name = CheckFileinResp(response)
|
1744 |
-
print("file_name:", file_name)
|
1745 |
-
if file_name != "N/A":
|
1746 |
-
|
1747 |
-
|
1748 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1749 |
except Exception as e:
|
1750 |
print("No need to add file in chatbot:", e)
|
1751 |
|
|
|
1583 |
|
1584 |
def retry(history3):
|
1585 |
global last_request
|
1586 |
+
global Filename_Chatbot
|
1587 |
print("last_request", last_request)
|
1588 |
message = last_request
|
1589 |
history3 = history3 + [(message, None)]
|
|
|
1602 |
# real_content = response[-1:]
|
1603 |
# print("real_content", real_content)
|
1604 |
try:
|
1605 |
+
# temp = response.split("(sandbox:/")[1] # (sandbox:/sample-20230805-0807.wav)
|
1606 |
+
# file_name = temp.split(")")[0]
|
1607 |
+
# print("file_name:", file_name)
|
1608 |
+
# history3 = history3 + [(None, (file_name,))]
|
1609 |
+
# yield history3
|
1610 |
+
file_names = CheckFileinResp(response)
|
1611 |
+
print("file_name:", file_names)
|
1612 |
+
if file_names != []:
|
1613 |
+
for file_name in file_names:
|
1614 |
+
if file_name != "":
|
1615 |
+
history2 = history2 + [(None, (file_name, file_name))]
|
1616 |
+
Filename_Chatbot = file_name
|
1617 |
+
yield history3
|
1618 |
+
else:
|
1619 |
+
print("No File Found in Response")
|
1620 |
except:
|
1621 |
print("No need to add file in chatbot")
|
1622 |
|
|
|
1751 |
# real_content = response[-1:]
|
1752 |
# print("real_content", real_content)
|
1753 |
try:
|
1754 |
+
# file_name = CheckFileinResp(response)
|
1755 |
+
# print("file_name:", file_name)
|
1756 |
+
# if file_name != "N/A":
|
1757 |
+
# history2 = history2 + [(None, (file_name,))]
|
1758 |
+
# Filename_Chatbot = file_name
|
1759 |
+
# yield [None, None, history2]
|
1760 |
+
file_names = CheckFileinResp(response)
|
1761 |
+
print("file_name:", file_names)
|
1762 |
+
if file_names != []:
|
1763 |
+
for file_name in file_names:
|
1764 |
+
if file_name != "":
|
1765 |
+
history2 = history2 + [(None, (file_name, file_name))]
|
1766 |
+
Filename_Chatbot = file_name
|
1767 |
+
yield [None, None, history2]
|
1768 |
except Exception as e:
|
1769 |
print("No need to add file in chatbot:", e)
|
1770 |
|