OuroborosM commited on
Commit
1ddf125
·
1 Parent(s): 5747f52

update name

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