Skip to content

Commit 04635ed

Browse files
authored
fix lint errors and lock deps (#8312)
1 parent 8fa2465 commit 04635ed

File tree

3 files changed

+2309
-2309
lines changed

3 files changed

+2309
-2309
lines changed

dspy/dsp/colbertv2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def forward(self, query: str, k: int = 7, **kwargs):
151151

152152
if kwargs.get("filtered_pids"):
153153
filtered_pids = kwargs.get("filtered_pids")
154-
assert type(filtered_pids) == List[int], "The filtered pids should be a list of integers"
154+
assert isinstance(filtered_pids, list) and all(isinstance(pid, int) for pid in filtered_pids), "The filtered pids should be a list of integers"
155155
device = "cuda" if torch.cuda.is_available() else "cpu"
156156
results = self.searcher.search(
157157
query,

dspy/streaming/streaming_listener.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ def find_predictor_for_stream_listeners(program: "Module", stream_listeners: Lis
193193
"predictor to use for streaming. Please specify the predictor to listen to."
194194
)
195195

196-
if field_info.annotation != str:
196+
if field_info.annotation is not str:
197197
raise ValueError(
198198
f"Stream listener can only be applied to string output field, but your field {field_name} is of "
199199
f"type {field_info.annotation}."

0 commit comments

Comments
 (0)