Update main.py
Browse files
main.py
CHANGED
@@ -65,18 +65,13 @@ async def generate_response(data: InputData) -> Dict[str, Any]:
|
|
65 |
cleaned_key = key.replace("###", "")
|
66 |
cleaned_response[cleaned_key] = value
|
67 |
|
68 |
-
"""for i, text in enumerate(cleaned_response["New response"]):
|
69 |
-
if i <= 2:
|
70 |
-
sentences = tokenizer.tokenize(text)
|
71 |
-
if sentences:
|
72 |
-
cleaned_response["New response"][i] = sentences[0]
|
73 |
-
else:
|
74 |
-
del cleaned_response["New response"][i]"""
|
75 |
-
|
76 |
strings = ""
|
77 |
|
78 |
-
for
|
79 |
-
|
|
|
|
|
|
|
80 |
|
81 |
sentences = tokenizer.tokenize(strings)
|
82 |
|
|
|
65 |
cleaned_key = key.replace("###", "")
|
66 |
cleaned_response[cleaned_key] = value
|
67 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
68 |
strings = ""
|
69 |
|
70 |
+
for i, text in enumerate(cleaned_response["New response"]):
|
71 |
+
if i != len(cleaned_response["New response"]) - 1:
|
72 |
+
strings += text + " "
|
73 |
+
else:
|
74 |
+
strings += text
|
75 |
|
76 |
sentences = tokenizer.tokenize(strings)
|
77 |
|