mirror of
https://github.com/hwchase17/langchain.git
synced 2025-09-11 07:50:47 +00:00
partners[lint]: run pyupgrade
to get code in line with 3.9 standards (#30781)
Using `pyupgrade` to get all `partners` code up to 3.9 standards (mostly, fixing old `typing` imports).
This commit is contained in:
@@ -1,8 +1,8 @@
|
||||
from typing import List, Union
|
||||
from typing import Union
|
||||
|
||||
import numpy as np
|
||||
|
||||
Matrix = Union[List[List[float]], List[np.ndarray], np.ndarray]
|
||||
Matrix = Union[list[list[float]], list[np.ndarray], np.ndarray]
|
||||
|
||||
|
||||
def maximal_marginal_relevance(
|
||||
@@ -10,7 +10,7 @@ def maximal_marginal_relevance(
|
||||
embedding_list: list,
|
||||
lambda_mult: float = 0.5,
|
||||
k: int = 4,
|
||||
) -> List[int]:
|
||||
) -> list[int]:
|
||||
"""Calculate maximal marginal relevance."""
|
||||
if min(k, len(embedding_list)) <= 0:
|
||||
return []
|
||||
|
Reference in New Issue
Block a user