Spaces:
Build error
Build error
Download basic_search.py from student-abdullah/NextGrocery: direct link, hf CLI and curl.
- Browser
- Download file 283 Bytes
-
https://huggingface.co/spaces/student-abdullah/NextGrocery/resolve/main/basic_search.py
- Command line
-
hf download hf://spaces/student-abdullah/NextGrocery/basic_search.py
-
curl -L -o basic_search.py https://huggingface.co/spaces/student-abdullah/NextGrocery/resolve/main/basic_search.py
283 Bytes
| from load_data import items | |
| # Simple search function | |
| def search_products(query, items): | |
| results = [] | |
| for transaction in items: | |
| for item in transaction: | |
| if query.lower() in item.lower(): | |
| results.append(item) | |
| return list(set(results)) | |