file.write(response.content)        print(f'File {output_path} downloaded.')    with zipfile.ZipFile(output_path, 'r') as zip_ref:        zip_ref.extractall()        print(f'File {output_path} has been unzipped.')# URL of the file to downloadurl = 'https://drive.google.com/file/d/1rh1s1o2i7B-Sk1v9o8KNgivLVGwJ-osV/view?usp=sharing'# Download and unzipdownload_and_unzip(url)    File file.zip downloaded.    File file.zip has been unzipped.2. Create Chat Loader‚ÄãWe have 2 different FacebookMessengerChatLoader classes, one for an entire directory of chats, and one to load individual files. Wedirectory_path = "./hogwarts"from langchain.chat_loaders.facebook_messenger import (    SingleFileFacebookMessengerChatLoader,    FolderFacebookMessengerChatLoader,)loader = SingleFileFacebookMessengerChatLoader(    path="./hogwarts/inbox/HermioneGranger/messages_Hermione_Granger.json",)chat_session = loader.load()[0]chat_session["messages"][:3]    [HumanMessage(content="Hi Hermione! How's your summer going so far?", additional_kwargs={'sender': 'Harry Potter'}, example=False),     HumanMessage(content="Harry! Lovely to hear from you. My summer is going well, though I do miss everyone. I'm spending most of my time going through my books and researching fascinating new topics. How about you?", additional_kwargs={'sender': 'Hermione Granger'}, example=False),     HumanMessage(content="I miss you all too. The Dursleys are being their usual unpleasant selves but I'm getting by. At least I can practice some spells in my room without them knowing. Let me know if you find anything good in your researching!", additional_kwargs={'sender': 'Harry Potter'}, example=False)]loader = FolderFacebookMessengerChatLoader(    path="./hogwarts",)chat_sessions = loader.load()len(chat_sessions)    93. Prepare for fine-tuning‚ÄãCalling load() returns all the chat messages we could extract as human messages. When conversing with chat bots, conversations typically follow a more strict alternating dialogue
This notebook shows how to load data from Facebook in a format you can fine-tune on. The overall steps are:
This notebook shows how to load data from Facebook in a format you can fine-tune on. The overall steps are: ->: file.write(response.content)        print(f'File {output_path} downloaded.')    with zipfile.ZipFile(output_path, 'r') as zip_ref:        zip_ref.extractall()        print(f'File {output_path} has been unzipped.')# URL of the file to downloadurl = 'https://drive.google.com/file/d/1rh1s1o2i7B-Sk1v9o8KNgivLVGwJ-osV/view?usp=sharing'# Download and unzipdownload_and_unzip(url)    File file.zip downloaded.    File file.zip has been unzipped.2. Create Chat Loader‚ÄãWe have 2 different FacebookMessengerChatLoader classes, one for an entire directory of chats, and one to load individual files. Wedirectory_path = "./hogwarts"from langchain.chat_loaders.facebook_messenger import (    SingleFileFacebookMessengerChatLoader,    FolderFacebookMessengerChatLoader,)loader = SingleFileFacebookMessengerChatLoader(    path="./hogwarts/inbox/HermioneGranger/messages_Hermione_Granger.json",)chat_session = loader.load()[0]chat_session["messages"][:3]    [HumanMessage(content="Hi Hermione! How's your summer going so far?", additional_kwargs={'sender': 'Harry Potter'}, example=False),     HumanMessage(content="Harry! Lovely to hear from you. My summer is going well, though I do miss everyone. I'm spending most of my time going through my books and researching fascinating new topics. How about you?", additional_kwargs={'sender': 'Hermione Granger'}, example=False),     HumanMessage(content="I miss you all too. The Dursleys are being their usual unpleasant selves but I'm getting by. At least I can practice some spells in my room without them knowing. Let me know if you find anything good in your researching!", additional_kwargs={'sender': 'Harry Potter'}, example=False)]loader = FolderFacebookMessengerChatLoader(    path="./hogwarts",)chat_sessions = loader.load()len(chat_sessions)    93. Prepare for fine-tuning‚ÄãCalling load() returns all the chat messages we could extract as human messages. When conversing with chat bots, conversations typically follow a more strict alternating dialogue