mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-30 17:29:56 +00:00
community[patch]: bugfix for YoutubeLoader
's LINES
format (#22815)
- **Description:** A change I submitted recently introduced a bug in `YoutubeLoader`'s `LINES` output format. In those conditions, curly braces ("`{}`") creates a set, not a dictionary. This bugfix explicitly specifies that a dictionary is created. - **Issue:** N/A - **Dependencies:** N/A - **Twitter:** lsloan_umich - **Mastodon:** [lsloan@mastodon.social](https://mastodon.social/@lsloan)
This commit is contained in:
parent
23c22fcbc9
commit
08c466c603
@ -282,11 +282,11 @@ class YoutubeLoader(BaseLoader):
|
|||||||
map(
|
map(
|
||||||
lambda transcript_piece: Document(
|
lambda transcript_piece: Document(
|
||||||
page_content=transcript_piece["text"].strip(" "),
|
page_content=transcript_piece["text"].strip(" "),
|
||||||
metadata={
|
metadata=dict(
|
||||||
filter(
|
filter(
|
||||||
lambda item: item[0] != "text", transcript_piece.items()
|
lambda item: item[0] != "text", transcript_piece.items()
|
||||||
)
|
)
|
||||||
},
|
),
|
||||||
),
|
),
|
||||||
transcript_pieces,
|
transcript_pieces,
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user