Kevin Hu
commited on
Commit
·
1c17452
1
Parent(s):
c62182e
Remove redundant param of rewrite component. (#4422)
Browse files### What problem does this PR solve?
### Type of change
- [x] Bug Fix (non-breaking change which fixes an issue)
agent/component/rewrite.py
CHANGED
@@ -29,7 +29,6 @@ class RewriteQuestionParam(GenerateParam):
|
|
29 |
super().__init__()
|
30 |
self.temperature = 0.9
|
31 |
self.prompt = ""
|
32 |
-
self.loop = 1
|
33 |
|
34 |
def check(self):
|
35 |
super().check()
|
@@ -85,13 +84,6 @@ class RewriteQuestion(Generate, ABC):
|
|
85 |
component_name = "RewriteQuestion"
|
86 |
|
87 |
def _run(self, history, **kwargs):
|
88 |
-
if not hasattr(self, "_loop"):
|
89 |
-
setattr(self, "_loop", 0)
|
90 |
-
if self._loop >= self._param.loop:
|
91 |
-
self._loop = 0
|
92 |
-
raise Exception("Sorry! Nothing relevant found.")
|
93 |
-
self._loop += 1
|
94 |
-
|
95 |
hist = self._canvas.get_history(4)
|
96 |
conv = []
|
97 |
for m in hist:
|
|
|
29 |
super().__init__()
|
30 |
self.temperature = 0.9
|
31 |
self.prompt = ""
|
|
|
32 |
|
33 |
def check(self):
|
34 |
super().check()
|
|
|
84 |
component_name = "RewriteQuestion"
|
85 |
|
86 |
def _run(self, history, **kwargs):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
hist = self._canvas.get_history(4)
|
88 |
conv = []
|
89 |
for m in hist:
|