Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
74bbba0
WIP anyscale
Sep 9, 2024
9c2fbb0
Moving to A100 node
Sep 13, 2024
7479a36
WIP starting notebook fr
Sep 18, 2024
765fe47
E2E notebook working - migrate to jobs + rayllm
Sep 24, 2024
dd06959
Remove offline modules
Sep 25, 2024
86e7740
pre-2.5
Oct 7, 2024
35bc427
WIP anyscale
Sep 9, 2024
33d54f4
Moving to A100 node
Sep 13, 2024
f97c09d
WIP starting notebook fr
Sep 18, 2024
2094431
E2E notebook working - migrate to jobs + rayllm
Sep 24, 2024
4082d5a
Remove offline modules
Sep 25, 2024
e3bb048
pre-2.5
Oct 7, 2024
e7ef3c4
Merge branch 'vllm-offline' of https://github.com/isaacbmiller/dspy i…
Oct 7, 2024
00014ef
WIP Converting to 2.5 LM FT
Oct 10, 2024
024fee6
Remove anyscale example
Oct 10, 2024
cc1f702
Clean files for PR
Oct 10, 2024
1684250
Updating trainable anyscale - to test
Oct 10, 2024
5289c70
Undo ensemble changes
Oct 11, 2024
b44de88
PR Cleaining
Oct 11, 2024
492d2e6
Job working
Oct 11, 2024
81accfe
Fix eval path pointing to default dataset
Oct 13, 2024
f231146
Fix eval path pointing to default dataset
Oct 13, 2024
9951d9b
Merge branch 'vllm-offline' of https://github.com/isaacbmiller/dspy i…
Oct 13, 2024
5ae10be
Remove trainable_openai
Oct 13, 2024
731f5a3
Merge remote-tracking branch 'private/vllm-offline' into origin/dev_f…
isaacbmiller Oct 13, 2024
baa5f49
WIP switching to Job
Oct 13, 2024
fc587b7
WIP FT working evals not
Oct 14, 2024
42c581f
confirmed new FT working
Oct 14, 2024
9d8e6d3
Ruff fixes
Oct 14, 2024
d6bbb09
Merge remote-tracking branch 'upstream/main' into dev_finetune
Oct 14, 2024
9b7d2a3
Cleanup for PR
Oct 14, 2024
33e82be
WIP Remove process_dataset_threaded
Oct 15, 2024
00101a7
Update anyscale client
Oct 15, 2024
bee6bfe
Merge branch 'dev_finetune' into anyscale_dev_finetune
dilarasoylu Oct 16, 2024
0d515a9
Re-add comment
dilarasoylu Oct 16, 2024
6888694
Re-add space
dilarasoylu Oct 16, 2024
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: 1 addition & 1 deletion dspy/adapters/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ def __call__(self, lm, lm_kwargs, signature, demos, inputs, _parse_values=True):
value = self.parse(signature, output, _parse_values=_parse_values)
assert set(value.keys()) == set(signature.output_fields.keys()), f"Expected {signature.output_fields.keys()} but got {value.keys()}"
values.append(value)

return values
21 changes: 19 additions & 2 deletions dspy/adapters/chat_adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,28 @@ def parse(self, signature, completion, _parse_values=True):
f"Error parsing field {k}: {e}.\n\n\t\tOn attempting to parse the value\n```\n{v}\n```"
)

if fields.keys() != signature.output_fields.keys():
raise ValueError(f"Expected {signature.output_fields.keys()} but got {fields.keys()}")
if list(fields.keys()) != list(signature.output_fields.keys()):
raise ValueError(f"Expected {list(signature.output_fields.keys())} but got {fields.keys()}")

return fields

def format_completion(self, signature, outputs):
reconstructed = []

fields_dict = signature.output_fields

field_name_output_map = {field: outputs[field] for field in fields_dict.keys()}

for field, value in field_name_output_map.items():
reconstructed.append(f"[[ ## {field} ## ]]")
reconstructed.append(str(value))
reconstructed.append("") # Add an empty line for separation

reconstructed.append("[[ ## completed ## ]]")

result = "\n".join(reconstructed).strip()

return result

def format_blob(blob):
if "\n" not in blob and "«" not in blob and "»" not in blob:
Expand Down
Loading
Loading