Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -40,7 +40,21 @@ weather_info_tool = WeatherInfoTool()
|
|
| 40 |
|
| 41 |
# # Initialize the Hub stats tool
|
| 42 |
hub_stats_tool = HubStatsTool()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
guest_info_tool = GuestInfoRetrieverTool(docs)
|
|
|
|
|
|
|
| 44 |
# # Load the guest dataset and initialize the guest info tool
|
| 45 |
latest_news_tool = LatestNewsTool()
|
| 46 |
# Create Alfred with all the tools
|
|
|
|
| 40 |
|
| 41 |
# # Initialize the Hub stats tool
|
| 42 |
hub_stats_tool = HubStatsTool()
|
| 43 |
+
|
| 44 |
+
|
| 45 |
+
from datasets import load_dataset
|
| 46 |
+
from langchain_core.documents import Document
|
| 47 |
+
|
| 48 |
+
# Load the dataset from Hugging Face
|
| 49 |
+
dataset = load_dataset("agents-course/unit3-invitees")["train"]
|
| 50 |
+
|
| 51 |
+
# Create Document objects from the "info" column
|
| 52 |
+
docs = [Document(page_content=row["description"]) for row in dataset]
|
| 53 |
+
|
| 54 |
+
# Initialize the tool
|
| 55 |
guest_info_tool = GuestInfoRetrieverTool(docs)
|
| 56 |
+
|
| 57 |
+
# guest_info_tool = GuestInfoRetrieverTool(docs)
|
| 58 |
# # Load the guest dataset and initialize the guest info tool
|
| 59 |
latest_news_tool = LatestNewsTool()
|
| 60 |
# Create Alfred with all the tools
|