sdg-hub 0.1.2__py3-none-any.whl → 0.1.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- sdg_hub/_version.py +2 -2
- sdg_hub/configs/annotations/simple_annotations.yaml +1 -1
- sdg_hub/configs/knowledge/evaluate_relevancy.yaml +1 -2
- sdg_hub/flow_runner.py +15 -2
- sdg_hub/flows/generation/knowledge/mmlu_bench.yaml +1 -1
- sdg_hub/flows/generation/knowledge/simple_knowledge.yaml +1 -1
- sdg_hub/flows/generation/knowledge/synth_knowledge.yaml +4 -4
- sdg_hub/flows/generation/knowledge/synth_knowledge1.5.yaml +8 -8
- {sdg_hub-0.1.2.dist-info → sdg_hub-0.1.3.dist-info}/METADATA +2 -2
- {sdg_hub-0.1.2.dist-info → sdg_hub-0.1.3.dist-info}/RECORD +13 -13
- {sdg_hub-0.1.2.dist-info → sdg_hub-0.1.3.dist-info}/WHEEL +0 -0
- {sdg_hub-0.1.2.dist-info → sdg_hub-0.1.3.dist-info}/licenses/LICENSE +0 -0
- {sdg_hub-0.1.2.dist-info → sdg_hub-0.1.3.dist-info}/top_level.txt +0 -0
sdg_hub/_version.py
CHANGED
@@ -9,7 +9,7 @@ principles: |
|
|
9
9
|
|
10
10
|
For each question, assign a score of 1 point if the response meets the criteria, and 0 points if it does not. After evaluating each question, provide detailed feedback explaining your reasoning behind the scores awarded.
|
11
11
|
|
12
|
-
Conclude your evaluation with a
|
12
|
+
Conclude your evaluation with a total score as a final result. The total score should represent the sum of points assigned for each question, with a maximum possible score of 2 points.
|
13
13
|
Only evaluate the response based on the above criteria, do not create new questions.
|
14
14
|
|
15
15
|
examples: |
|
@@ -49,7 +49,6 @@ examples: |
|
|
49
49
|
0
|
50
50
|
[End of Score]
|
51
51
|
|
52
|
-
|
53
52
|
Example 3:
|
54
53
|
[Start of Question]
|
55
54
|
What are the benefits of electric vehicles?
|
sdg_hub/flow_runner.py
CHANGED
@@ -42,6 +42,7 @@ def run_flow(
|
|
42
42
|
debug: bool = False,
|
43
43
|
dataset_start_index: int = 0,
|
44
44
|
dataset_end_index: Optional[int] = None,
|
45
|
+
api_key: Optional[str] = None,
|
45
46
|
) -> None:
|
46
47
|
"""Process the dataset using the specified configuration.
|
47
48
|
|
@@ -69,6 +70,8 @@ def run_flow(
|
|
69
70
|
Start index for dataset slicing, by default 0.
|
70
71
|
dataset_end_index : Optional[int], optional
|
71
72
|
End index for dataset slicing, by default None.
|
73
|
+
api_key : Optional[str], optional
|
74
|
+
API key for the remote endpoint. If not provided, will use OPENAI_API_KEY environment variable, by default None.
|
72
75
|
|
73
76
|
Returns
|
74
77
|
-------
|
@@ -137,9 +140,9 @@ def run_flow(
|
|
137
140
|
) from e
|
138
141
|
|
139
142
|
# Validate API configuration
|
140
|
-
openai_api_key = os.environ.get("OPENAI_API_KEY")
|
143
|
+
openai_api_key = api_key or os.environ.get("OPENAI_API_KEY")
|
141
144
|
if not openai_api_key or openai_api_key == "EMPTY":
|
142
|
-
logger.warning("OPENAI_API_KEY not set or is 'EMPTY'. API calls may fail.")
|
145
|
+
logger.warning("API key not provided and OPENAI_API_KEY not set or is 'EMPTY'. API calls may fail.")
|
143
146
|
|
144
147
|
openai_api_base = endpoint
|
145
148
|
if not openai_api_base:
|
@@ -349,6 +352,12 @@ def run_flow(
|
|
349
352
|
@click.option(
|
350
353
|
"--dataset_end_index", type=int, default=None, help="End index of the dataset."
|
351
354
|
)
|
355
|
+
@click.option(
|
356
|
+
"--api_key",
|
357
|
+
type=str,
|
358
|
+
default=None,
|
359
|
+
help="API key for the remote endpoint. If not provided, will use OPENAI_API_KEY environment variable.",
|
360
|
+
)
|
352
361
|
def main(
|
353
362
|
ds_path: str,
|
354
363
|
bs: int,
|
@@ -361,6 +370,7 @@ def main(
|
|
361
370
|
debug: bool,
|
362
371
|
dataset_start_index: int,
|
363
372
|
dataset_end_index: Optional[int],
|
373
|
+
api_key: Optional[str],
|
364
374
|
) -> None:
|
365
375
|
"""CLI entry point for running data generation flows.
|
366
376
|
|
@@ -388,6 +398,8 @@ def main(
|
|
388
398
|
Start index for dataset slicing.
|
389
399
|
dataset_end_index : Optional[int]
|
390
400
|
End index for dataset slicing.
|
401
|
+
api_key : Optional[str]
|
402
|
+
API key for the remote endpoint. If not provided, will use OPENAI_API_KEY environment variable.
|
391
403
|
|
392
404
|
Returns
|
393
405
|
-------
|
@@ -406,6 +418,7 @@ def main(
|
|
406
418
|
debug=debug,
|
407
419
|
dataset_start_index=dataset_start_index,
|
408
420
|
dataset_end_index=dataset_end_index,
|
421
|
+
api_key=api_key,
|
409
422
|
)
|
410
423
|
except (
|
411
424
|
DatasetLoadError,
|
@@ -2,7 +2,7 @@
|
|
2
2
|
block_config:
|
3
3
|
block_name: gen_knowledge
|
4
4
|
config_path: configs/knowledge/generate_questions_responses.yaml
|
5
|
-
model_id:
|
5
|
+
model_id: meta-llama/Llama-3.3-70B-Instruct
|
6
6
|
output_cols:
|
7
7
|
- question
|
8
8
|
- response
|
@@ -20,7 +20,7 @@
|
|
20
20
|
block_config:
|
21
21
|
block_name: eval_faithfulness_qa_pair
|
22
22
|
config_path: configs/knowledge/evaluate_faithfulness.yaml
|
23
|
-
model_id:
|
23
|
+
model_id: meta-llama/Llama-3.3-70B-Instruct
|
24
24
|
output_cols:
|
25
25
|
- explanation
|
26
26
|
- judgment
|
@@ -43,7 +43,7 @@
|
|
43
43
|
block_config:
|
44
44
|
block_name: eval_relevancy_qa_pair
|
45
45
|
config_path: configs/knowledge/evaluate_relevancy.yaml
|
46
|
-
model_id:
|
46
|
+
model_id: meta-llama/Llama-3.3-70B-Instruct
|
47
47
|
output_cols:
|
48
48
|
- feedback
|
49
49
|
- score
|
@@ -67,7 +67,7 @@
|
|
67
67
|
block_config:
|
68
68
|
block_name: eval_verify_question
|
69
69
|
config_path: configs/knowledge/evaluate_question.yaml
|
70
|
-
model_id:
|
70
|
+
model_id: meta-llama/Llama-3.3-70B-Instruct
|
71
71
|
output_cols:
|
72
72
|
- explanation
|
73
73
|
- rating
|
@@ -8,7 +8,7 @@
|
|
8
8
|
block_config:
|
9
9
|
block_name: gen_detailed_summary
|
10
10
|
config_path: configs/knowledge/detailed_summary.yaml
|
11
|
-
model_id:
|
11
|
+
model_id: meta-llama/Llama-3.3-70B-Instruct
|
12
12
|
output_cols:
|
13
13
|
- summary_detailed
|
14
14
|
gen_kwargs:
|
@@ -20,7 +20,7 @@
|
|
20
20
|
block_config:
|
21
21
|
block_name: gen_atomic_facts
|
22
22
|
config_path: configs/knowledge/atomic_facts.yaml
|
23
|
-
model_id:
|
23
|
+
model_id: meta-llama/Llama-3.3-70B-Instruct
|
24
24
|
output_cols:
|
25
25
|
- summary_atomic_facts
|
26
26
|
gen_kwargs:
|
@@ -31,7 +31,7 @@
|
|
31
31
|
block_config:
|
32
32
|
block_name: gen_extractive_summary
|
33
33
|
config_path: configs/knowledge/extractive_summary.yaml
|
34
|
-
model_id:
|
34
|
+
model_id: meta-llama/Llama-3.3-70B-Instruct
|
35
35
|
output_cols:
|
36
36
|
- summary_extractive
|
37
37
|
gen_kwargs:
|
@@ -60,7 +60,7 @@
|
|
60
60
|
block_config:
|
61
61
|
block_name: knowledge generation
|
62
62
|
config_path: configs/knowledge/generate_questions.yaml
|
63
|
-
model_id:
|
63
|
+
model_id: meta-llama/Llama-3.3-70B-Instruct
|
64
64
|
output_cols:
|
65
65
|
- question
|
66
66
|
parser_kwargs:
|
@@ -74,7 +74,7 @@
|
|
74
74
|
block_config:
|
75
75
|
block_name: knowledge generation
|
76
76
|
config_path: configs/knowledge/generate_responses.yaml
|
77
|
-
model_id:
|
77
|
+
model_id: meta-llama/Llama-3.3-70B-Instruct
|
78
78
|
output_cols:
|
79
79
|
- response
|
80
80
|
gen_kwargs:
|
@@ -85,7 +85,7 @@
|
|
85
85
|
block_config:
|
86
86
|
block_name: eval_faithfulness_qa_pair
|
87
87
|
config_path: configs/knowledge/evaluate_faithfulness.yaml
|
88
|
-
model_id:
|
88
|
+
model_id: meta-llama/Llama-3.3-70B-Instruct
|
89
89
|
output_cols:
|
90
90
|
- explanation
|
91
91
|
- judgment
|
@@ -106,7 +106,7 @@
|
|
106
106
|
block_config:
|
107
107
|
block_name: eval_relevancy_qa_pair
|
108
108
|
config_path: configs/knowledge/evaluate_relevancy.yaml
|
109
|
-
model_id:
|
109
|
+
model_id: meta-llama/Llama-3.3-70B-Instruct
|
110
110
|
output_cols:
|
111
111
|
- feedback
|
112
112
|
- score
|
@@ -128,7 +128,7 @@
|
|
128
128
|
block_config:
|
129
129
|
block_name: eval_verify_question
|
130
130
|
config_path: configs/knowledge/evaluate_question.yaml
|
131
|
-
model_id:
|
131
|
+
model_id: meta-llama/Llama-3.3-70B-Instruct
|
132
132
|
output_cols:
|
133
133
|
- explanation
|
134
134
|
- rating
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: sdg_hub
|
3
|
-
Version: 0.1.
|
3
|
+
Version: 0.1.3
|
4
4
|
Summary: Synthetic Data Generation
|
5
5
|
Author-email: Red Hat AI Innovation <abhandwa@redhat.com>
|
6
6
|
License: Apache-2.0
|
@@ -36,7 +36,7 @@ Requires-Dist: flask>=3.0.2; extra == "web-interface"
|
|
36
36
|
Requires-Dist: pyyaml>=6.0.1; extra == "web-interface"
|
37
37
|
Requires-Dist: flask-wtf>=1.2.2; extra == "web-interface"
|
38
38
|
Provides-Extra: vllm
|
39
|
-
Requires-Dist: vllm
|
39
|
+
Requires-Dist: vllm>=0.9.1; extra == "vllm"
|
40
40
|
Requires-Dist: torch>=2.0.0; extra == "vllm"
|
41
41
|
Requires-Dist: transformers>=4.37.0; extra == "vllm"
|
42
42
|
Requires-Dist: accelerate>=0.21.0; extra == "vllm"
|
@@ -1,8 +1,8 @@
|
|
1
1
|
sdg_hub/__init__.py,sha256=5Wa6onDndPvG4iwnjq2jK747t3-7XKdQn2WfHfq1sFc,67
|
2
|
-
sdg_hub/_version.py,sha256=
|
2
|
+
sdg_hub/_version.py,sha256=NIzzV8ZM0W-CSLuEs1weG4zPrn_-8yr1AwwI1iuS6yo,511
|
3
3
|
sdg_hub/checkpointer.py,sha256=R0pNKL_q7-BerxmIarY0w1nFYaq7fGnoRRkCVL6Z-Gw,5053
|
4
4
|
sdg_hub/flow.py,sha256=14WDZfb-VDUBwXsVo9u5oMuWD6aOm-GWtIdT64z4j-0,18050
|
5
|
-
sdg_hub/flow_runner.py,sha256=
|
5
|
+
sdg_hub/flow_runner.py,sha256=rSoXoN2n2vsMmOnsRImeQivsY9zlrDig53O9DBbQzz0,15177
|
6
6
|
sdg_hub/logger_config.py,sha256=7uHEJVRfym1c4n95DOKHelLXqAus8uHsZYmzLsEjqpo,422
|
7
7
|
sdg_hub/pipeline.py,sha256=mahktfoCMVnuBnvLNjAVOAoFKNQo-wb0Dz1_xdYhKDM,3852
|
8
8
|
sdg_hub/prompts.py,sha256=Gto1KcIhO-50ERvZx1Qzu-eAhSlIkOjYH9F6j2eIPfY,17482
|
@@ -20,14 +20,14 @@ sdg_hub/configs/annotations/cot_reflection.yaml,sha256=60EdsTe1y7GoUIAWYSGfMa3EK
|
|
20
20
|
sdg_hub/configs/annotations/detailed_annotations.yaml,sha256=in21xmlhxDJGEaWh1IgINh33tEyW9AuyG3k4pWBuKSM,1520
|
21
21
|
sdg_hub/configs/annotations/detailed_description.yaml,sha256=FsGbQMBxf1MAOi0nhrQ4icxcwYMlRura_ji9Pmeh1AA,192
|
22
22
|
sdg_hub/configs/annotations/detailed_description_icl.yaml,sha256=NDdwo5EShnYZjm1Fn80sZTAwfnwpPigixP2hvJ8--cU,679
|
23
|
-
sdg_hub/configs/annotations/simple_annotations.yaml,sha256=
|
23
|
+
sdg_hub/configs/annotations/simple_annotations.yaml,sha256=d80d0mK7Xz0MMCCSW3sYw3ztt5HASV5miu0krSAbjnA,234
|
24
24
|
sdg_hub/configs/knowledge/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
25
25
|
sdg_hub/configs/knowledge/atomic_facts.yaml,sha256=bIfQr0q0FyReO94v_lpLO56FikARCvFmZza-ISZTOnA,2453
|
26
26
|
sdg_hub/configs/knowledge/auxilary_instructions.yaml,sha256=aCgIjvNacdC2ZHThEvhZKvwORK6KqErVvVYQYQrIDLE,2034
|
27
27
|
sdg_hub/configs/knowledge/detailed_summary.yaml,sha256=_Mc_i9vaLp1OPKexSOURV5gbXEG41p1eELUukOhz8oM,388
|
28
28
|
sdg_hub/configs/knowledge/evaluate_faithfulness.yaml,sha256=iuvx5vNNm_jzHlmcKF83StaDYezRz2vQn3JUHM-TMdQ,3054
|
29
29
|
sdg_hub/configs/knowledge/evaluate_question.yaml,sha256=02mikEAJCUEkREBo7KxPY9H6iTUHQN-4cRkn2XMlVQ8,1915
|
30
|
-
sdg_hub/configs/knowledge/evaluate_relevancy.yaml,sha256=
|
30
|
+
sdg_hub/configs/knowledge/evaluate_relevancy.yaml,sha256=yPyW2BeLV07cvDU8NO6f-Wc32P9iycnpXyLvvTnUy44,3651
|
31
31
|
sdg_hub/configs/knowledge/extractive_summary.yaml,sha256=TYgJ7WQc7NFkf3GeRsbx6lwfA_xFnEOYGELewSqorp0,399
|
32
32
|
sdg_hub/configs/knowledge/generate_code_questions_responses.yaml,sha256=cIus2JYMYDvxHFVSU9QVa-1IK5KoChb3rCU2b4b9UmI,908
|
33
33
|
sdg_hub/configs/knowledge/generate_questions.yaml,sha256=iJtttZrVvlXFraUSrMowqTCLoJOLDbBndcTNMPTO8A4,2788
|
@@ -67,10 +67,10 @@ sdg_hub/configs/skills/icl_examples/math.yaml,sha256=hNq-QudlXrg9CWLpJdrZ4v3vifG
|
|
67
67
|
sdg_hub/configs/skills/icl_examples/reasoning.yaml,sha256=eesIlH9SO07TVF20gy18MZrcDzLhSmynd_F_lvg0oQg,4335
|
68
68
|
sdg_hub/configs/skills/icl_examples/roleplay.yaml,sha256=LYEyA7wv7QWQscUNQr0K_lotNoWSfuoAEncx3PCRYIs,6997
|
69
69
|
sdg_hub/configs/skills/icl_examples/writing.yaml,sha256=El-57IjZ5IvdcmCHyHvX_M2RFFkEos572220be8ecrQ,11335
|
70
|
-
sdg_hub/flows/generation/knowledge/mmlu_bench.yaml,sha256=
|
71
|
-
sdg_hub/flows/generation/knowledge/simple_knowledge.yaml,sha256=
|
72
|
-
sdg_hub/flows/generation/knowledge/synth_knowledge.yaml,sha256=
|
73
|
-
sdg_hub/flows/generation/knowledge/synth_knowledge1.5.yaml,sha256=
|
70
|
+
sdg_hub/flows/generation/knowledge/mmlu_bench.yaml,sha256=U0S2NPkZ_9_8yQGgHJm4el-wVsg_6MllzbFT97cGNrI,343
|
71
|
+
sdg_hub/flows/generation/knowledge/simple_knowledge.yaml,sha256=_DkBZjS47bH0Lmu0eXVRlesTxeAF8Zlzj1PgR1vruuA,295
|
72
|
+
sdg_hub/flows/generation/knowledge/synth_knowledge.yaml,sha256=sYBzIFNBGks_o2Nwvov5MSrMadAB3g-niBAaWPbBYO0,2160
|
73
|
+
sdg_hub/flows/generation/knowledge/synth_knowledge1.5.yaml,sha256=Ao91pCtPmyJts0_aLDkl7n3q14ndvzN_nNIm5Q0RnMI,3610
|
74
74
|
sdg_hub/flows/generation/skills/improve_responses.yaml,sha256=wUV0awTmKHNZ62pHiw_yz-IdG0OYgT_dCwlMUlZS3TA,2683
|
75
75
|
sdg_hub/flows/generation/skills/simple_freeform_skill.yaml,sha256=iVEomFH1E52JA7KLmTIwkS1PnzxUJVPMgbK2O-m80As,309
|
76
76
|
sdg_hub/flows/generation/skills/simple_grounded_skill.yaml,sha256=LTLxqdgbLIKSJonuIRHhcRSpit1EawwNvytWzXWXe2E,309
|
@@ -82,8 +82,8 @@ sdg_hub/utils/datautils.py,sha256=0t_SZ_UXBKl8uL6rVp3SUh8YKRbzKlh2oO5gr2cKyEw,38
|
|
82
82
|
sdg_hub/utils/error_handling.py,sha256=UvPEmtdpbBL71Zx8DWpIqd8869kEY2dlCH11iDgMfec,1847
|
83
83
|
sdg_hub/utils/path_resolution.py,sha256=M7hnwoyRQTKgwGC3Ld1_KmKaO_8Lu0PCk6JtQrLp67Q,2006
|
84
84
|
sdg_hub/utils/validation_result.py,sha256=O3zF6r49LQ9StAf_oWmK2bg-JfTQw6rpbHtHr9lI4ks,264
|
85
|
-
sdg_hub-0.1.
|
86
|
-
sdg_hub-0.1.
|
87
|
-
sdg_hub-0.1.
|
88
|
-
sdg_hub-0.1.
|
89
|
-
sdg_hub-0.1.
|
85
|
+
sdg_hub-0.1.3.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
86
|
+
sdg_hub-0.1.3.dist-info/METADATA,sha256=v8k82qCPIhwhS_rBAe8S3SXTl_xu7UBAoi6NB3vzT3s,7240
|
87
|
+
sdg_hub-0.1.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
88
|
+
sdg_hub-0.1.3.dist-info/top_level.txt,sha256=TqI7d-HE1n6zkXFkU0nF3A1Ct0P0pBaqI675uFokhx4,8
|
89
|
+
sdg_hub-0.1.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|