mirror of
https://github.com/OpenSPG/openspg.git
synced 2025-11-30 09:10:33 +00:00
fix nn4k error
This commit is contained in:
parent
03d19c4053
commit
cebca72c43
@ -66,7 +66,7 @@ class LLMBasedExtractor(SPGExtractor):
|
||||
def to_rest(self):
|
||||
"""Transforms `LLMBasedExtractor` to REST model `ExtractNodeConfig`."""
|
||||
params = dict()
|
||||
params["model_config"] = json.dumps(self.llm._nn_config)
|
||||
params["model_config"] = json.dumps(self.llm.init_args)
|
||||
params["prompt_config"] = json.dumps(
|
||||
[OperatorClient().serialize(op.to_rest()) for op in self.prompt_ops]
|
||||
)
|
||||
|
||||
@ -165,7 +165,7 @@ class PromptOp(BaseOp, ABC):
|
||||
) -> List[Dict[str, str]]:
|
||||
if isinstance(response, list) and len(response) > 0:
|
||||
response = response[0]
|
||||
variables.update({f"{self.name}": response})
|
||||
variables.update({f"{self.__class__.__name__}": response})
|
||||
return [variables]
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user