Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

fix: create synthesis run should accept da as input #748

Merged
merged 2 commits into from
Jun 1, 2023
Merged
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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixed

- Fix create synthesis run not accepting `DocumentArray` as input type. ([#748](https://github.com/jina-ai/finetuner/pull/748))

### Docs


Expand Down
20 changes: 10 additions & 10 deletions finetuner/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,16 +241,16 @@ def create_synthesis_run(
run_name = get_random_name()

csv_context = CSVContext(None, options=csv_options)
query_data = (
csv_context.build_dataset(data=query_data)
if isinstance(query_data, str)
else DocumentArray([Document(text=data) for data in query_data])
)
corpus_data = (
csv_context.build_dataset(data=corpus_data)
if isinstance(query_data, str)
else DocumentArray([Document(text=data) for data in corpus_data])
)
if isinstance(query_data, str):
query_data = csv_context.build_dataset(data=query_data)
elif isinstance(query_data, list):
query_data = DocumentArray([Document(text=data) for data in query_data])

if isinstance(corpus_data, str):
corpus_data = csv_context.build_dataset(data=corpus_data)
elif isinstance(corpus_data, list):
corpus_data = DocumentArray([Document(text=data) for data in corpus_data])

query_data, corpus_data = push_synthesis_data(
experiment_name=self._name,
run_name=run_name,
Expand Down