Skip to content

Commit

Permalink
Python 3.9 compatability
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasahle committed Mar 3, 2024
1 parent f223579 commit dab44cd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dspy/signatures/signature.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ class MySignature(Signature):
pass


def ensure_signature(signature: str | Type[Signature]) -> Signature:
def ensure_signature(signature: Union[str, Type[Signature]]) -> Signature:
if signature is None:
return None
if isinstance(signature, str):
Expand Down
3 changes: 2 additions & 1 deletion dspy/utils/dummies.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import random
from typing import Union
from dsp.modules import LM
import numpy as np
from dsp.utils.utils import dotdict
Expand All @@ -8,7 +9,7 @@
class DummyLM(LM):
"""Dummy language model for unit testing purposes."""

def __init__(self, answers: list[str] | dict[str, str], follow_examples: bool = False):
def __init__(self, answers: Union[list[str], dict[str, str]], follow_examples: bool = False):
"""Initializes the dummy language model.
Parameters:
Expand Down

0 comments on commit dab44cd

Please sign in to comment.