OuroborosM commited on
Commit
9674fb9
·
1 Parent(s): 1ddf125

update output

Browse files
Files changed (1) hide show
  1. app.py +8 -4
app.py CHANGED
@@ -94,15 +94,19 @@ class GPTRemote(LLM):
94
  # output = "test custom llm"
95
  print(type(output))
96
  print(output)
97
- output2 = self.treat_output(output)
98
-
99
- return output2
 
 
 
100
 
101
  @property
102
  def _identifying_params(self) -> Mapping[str, Any]:
103
  return [("n", self.n)]
104
 
105
- def treat_output(text: str):
 
106
  keywords = ['Action:', 'Action Input:', 'Observation:', 'Thought:', 'Final Answer:']
107
  for item in keywords:
108
  if item in text:
 
94
  # output = "test custom llm"
95
  print(type(output))
96
  print(output)
97
+ keywords = ['Action:', 'Action Input:', 'Observation:', 'Thought:', 'Final Answer:']
98
+ for item in keywords:
99
+ if item in output:
100
+ output.replace(item, '\n'+item)
101
+ print("treat output: ", output)
102
+ return output
103
 
104
  @property
105
  def _identifying_params(self) -> Mapping[str, Any]:
106
  return [("n", self.n)]
107
 
108
+ def treat_output(text):
109
+
110
  keywords = ['Action:', 'Action Input:', 'Observation:', 'Thought:', 'Final Answer:']
111
  for item in keywords:
112
  if item in text: