You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -153,17 +153,17 @@ then you can refer to: [Install Dependencies](requirements)
153
153
154
154
## Register Rules/Prompts/Models
155
155
156
-
If the heuristic rules inside the project do not meet the user's quality inspection requirements, users can also customize rules or models.
156
+
If the heuristic rules inside the project do not meet the user's quality inspection requirements, users can also customize rules or models.
157
157
158
158
### Register Rules
159
159
160
-
If the user wants to create a new rule `CommonPatternDemo`, then the first step is to add a decorator to the rule to inject the rule into the project.
161
-
Secondly, the `metric_type` type, such as `QUALITY_BAD_RELEVANCE`, needs to be set for the rule, and `group` does not need to be set.
162
-
Then the user needs to define the `DynamicRuleConfig` object, so that the properties of the rule can be configured dynamically.
163
-
In addition, the method name of the rule must be `eval` and it needs to be a class method.
164
-
The return value of the last step should be a `ModelRes` object.
160
+
If the user wants to create a new rule `CommonPatternDemo`, then the first step is to add a decorator to the rule to inject the rule into the project.
161
+
Secondly, the `metric_type` type, such as `QUALITY_BAD_RELEVANCE`, needs to be set for the rule, and `group` does not need to be set.
162
+
Then the user needs to define the `DynamicRuleConfig` object, so that the properties of the rule can be configured dynamically.
163
+
In addition, the method name of the rule must be `eval` and it needs to be a class method.
164
+
The return value of the last step should be a `ModelRes` object.
165
165
166
-
For example: [Register Rules](examples/register/sdk_register_rule.py)
166
+
For example: [Register Rules](examples/register/sdk_register_rule.py)
167
167
168
168
### Register Prompts
169
169
@@ -173,8 +173,8 @@ For example: [Register Prompts](examples/register/sdk_register_prompt.py)
173
173
174
174
### Register Models
175
175
176
-
The way to register models is slightly different, users need to implement a call_api method, accept MetaData type parameters, and return ModelRes type results.
177
-
There are already implemented basic model classes [BaseOpenAI](dingo/model/llm/base_openai.py) in the project, users can directly inherit.
176
+
The way to register models is slightly different, users need to implement a call_api method, accept MetaData type parameters, and return ModelRes type results.
177
+
There are already implemented basic model classes [BaseOpenAI](dingo/model/llm/base_openai.py) in the project, users can directly inherit.
178
178
If the user has special functions to implement, then you can rewrite the corresponding methods.
179
179
180
180
For example: [Register Models](examples/register/sdk_register_llm.py)
@@ -185,7 +185,7 @@ For example: [Register Models](examples/register/sdk_register_llm.py)
185
185
186
186
## Execution Engine
187
187
188
-
`Dingo` can run locally or on a spark cluster.
188
+
`Dingo` can run locally or on a spark cluster.
189
189
Regardless of the choice of engine, the executor supports some common methods:
190
190
191
191
| function name | description |
@@ -203,9 +203,9 @@ When choosing the spark engine, users can freely choose rules, models for qualit
203
203
204
204
### Spark Mode
205
205
206
-
When choosing the spark engine, users can only choose rules for quality inspection, and models cannot be used.
207
-
And only `eval_group`,`save_data`,`save_correct`,`custom_config` in `InputArgs` are still valid.
208
-
Therefore, the user needs to input `spark_session` to initialize spark, and input `spark_rdd` (composed of `MetaData` structure) as data for quality inspection.
206
+
When choosing the spark engine, users can only choose rules for quality inspection, and models cannot be used.
207
+
And only `eval_group`,`save_data`,`save_correct`,`custom_config` in `InputArgs` are still valid.
208
+
Therefore, the user needs to input `spark_session` to initialize spark, and input `spark_rdd` (composed of `MetaData` structure) as data for quality inspection.
209
209
It should be noted that if `save_data` is `False`, then the data in memory will be cleared immediately after the quality inspection is completed, and `spark_session` will also stop immediately.
210
210
211
211
[Spark Example](examples/spark/sdk_spark.py)
@@ -278,4 +278,4 @@ If you find this project useful, please consider citing our tool:
0 commit comments