Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions .github/workflows/IntegrationTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ name: Test

on:
push:
branches: [ "*" ]
pull_request:
branches: [ "*" ]
branches: [ "main", "dev" ]
pull_request_target:
branches: [ "main", "dev" ]
workflow_dispatch:


Expand Down Expand Up @@ -58,3 +58,13 @@ jobs:
- name: Run unit tests
run: |
pytest test/scripts --ignore=test/scripts/data
- name: Run examples
env:
OPENAI_KEY: ${{ secrets.OPENAI_KEY }}
run: |
python examples/core/score.py
python examples/custom/sdk_custom_rule.py
python examples/llm_and_rule/llm_and_rule_mix.py
python examples/register/sdk_register_llm.py
python examples/register/sdk_register_prompt.py
python examples/register/sdk_register_rule.py
13 changes: 0 additions & 13 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,6 @@ jobs:
python -m pip install --upgrade pip
pip install build wheel==0.43.0 twine==6.0.1 packaging==24.1 pkginfo==1.12.0

- name: Run examples
env:
OPENAI_KEY: ${{ secrets.OPENAI_KEY }}
run: |
python examples/core/score.py
python examples/custom/sdk_custom_rule.py
python examples/llm_and_rule/llm_and_rule_mix.py
python examples/register/sdk_register_llm.py
python examples/register/sdk_register_prompt.py
python examples/register/sdk_register_rule.py
python examples/multi_turn_dialogues/sdk_mtbench101_llm.py
python examples/multi_turn_dialogues/sdk_mtbench101_rule_all.py

- name: Build package
run: python setup.py bdist_wheel

Expand Down
2 changes: 2 additions & 0 deletions examples/core/score.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
OPENAI_MODEL = 'deepseek-chat'
OPENAI_URL = 'https://api.deepseek.com/v1'
OPENAI_KEY = os.getenv("OPENAI_KEY")
if not OPENAI_KEY:
raise ValueError('OPENAI_KEY is not set correctly.')


def llm():
Expand Down
2 changes: 1 addition & 1 deletion examples/custom/sdk_custom_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from dingo.exec import Executor

input_data = {
"input_path": "../../test/data/test_local_jsonl.jsonl",
"input_path": "test/data/test_local_jsonl.jsonl",
"dataset": {
"source": "local",
"format": "jsonl",
Expand Down
2 changes: 1 addition & 1 deletion examples/custom/sdk_custom_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from dingo.exec import Executor

input_data = {
"input_path": "../../test/data/test_local_json.json",
"input_path": "test/data/test_local_json.json",
"dataset": {
"source": "local",
"format": "json",
Expand Down
4 changes: 3 additions & 1 deletion examples/llm_and_rule/llm_and_rule_mix.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
OPENAI_MODEL = 'deepseek-chat'
OPENAI_URL = 'https://api.deepseek.com/v1'
OPENAI_KEY = os.getenv("OPENAI_KEY")
if not OPENAI_KEY:
raise ValueError('OPENAI_KEY is not set correctly.')

input_data = {
"input_path": "../../test/data/test_local_jsonl.jsonl",
"input_path": "test/data/test_local_jsonl.jsonl",
"dataset": {
"source": "local",
"format": "jsonl",
Expand Down
2 changes: 1 addition & 1 deletion examples/llm_and_rule/local_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from dingo.exec import Executor

input_data = {
"input_path": "../../test/data/test_local_jsonl.jsonl",
"input_path": "test/data/test_local_jsonl.jsonl",
"dataset": {
"source": "local",
"format": "jsonl",
Expand Down
2 changes: 1 addition & 1 deletion examples/llm_and_rule/remote_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from dingo.exec import Executor

input_data = {
"input_path": "../../test/data/test_local_jsonl.jsonl",
"input_path": "test/data/test_local_jsonl.jsonl",
"dataset": {
"source": "local",
"format": "jsonl",
Expand Down
2 changes: 1 addition & 1 deletion examples/multi_turn_dialogues/sdk_mtbench101_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
OPENAI_KEY = os.getenv("OPENAI_KEY")

input_data = {
"input_path": "../../test/data/test_mtbench101_jsonl.jsonl",
"input_path": "test/data/test_mtbench101_jsonl.jsonl",
"dataset": {
"source": "local",
"format": "multi_turn_dialog",
Expand Down
2 changes: 1 addition & 1 deletion examples/multi_turn_dialogues/sdk_mtbench101_rule_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from dingo.exec import Executor

input_data = {
"input_path": "../../test/data/test_mtbench101_jsonl.jsonl",
"input_path": "test/data/test_mtbench101_jsonl.jsonl",
"dataset": {
"source": "local",
"format": "multi_turn_dialog",
Expand Down
4 changes: 3 additions & 1 deletion examples/register/sdk_register_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
OPENAI_MODEL = 'deepseek-chat'
OPENAI_URL = 'https://api.deepseek.com/v1'
OPENAI_KEY = os.getenv("OPENAI_KEY")
if not OPENAI_KEY:
raise ValueError('OPENAI_KEY is not set correctly.')


@Model.llm_register('LlmTextQualityRegister')
Expand Down Expand Up @@ -54,7 +56,7 @@ def process_response(cls, response: str) -> ModelRes:
from dingo.exec import Executor

input_data = {
"input_path": "../../test/data/test_local_jsonl.jsonl",
"input_path": "test/data/test_local_jsonl.jsonl",
"dataset": {
"source": "local",
"format": "jsonl",
Expand Down
4 changes: 3 additions & 1 deletion examples/register/sdk_register_prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
OPENAI_MODEL = 'deepseek-chat'
OPENAI_URL = 'https://api.deepseek.com/v1'
OPENAI_KEY = os.getenv("OPENAI_KEY")
if not OPENAI_KEY:
raise ValueError('OPENAI_KEY is not set correctly.')


@Model.prompt_register("QUALITY_BAD_SIMILARITY", [])
Expand All @@ -24,7 +26,7 @@ class PromptRepeatDemo(BasePrompt):
from dingo.exec import Executor

input_data = {
"input_path": "../../test/data/test_local_jsonl.jsonl",
"input_path": "test/data/test_local_jsonl.jsonl",
"dataset": {
"source": "local",
"format": "jsonl",
Expand Down
2 changes: 1 addition & 1 deletion examples/register/sdk_register_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def eval(cls, input_data: Data) -> ModelRes:
from dingo.exec import Executor

input_data = {
"input_path": "../../test/data/test_local_json.json",
"input_path": "test/data/test_local_json.json",
"dataset": {
"source": "local",
"format": "json",
Expand Down