oflakne26 commited on
Commit
db1d7e1
1 Parent(s): e4a9c84

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +5 -10
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 _, text in enumerate(cleaned_response["New response"]):
79
- strings += " " + text
 
 
 
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