Spaces:
Sleeping
Sleeping
Download modules/ddg_search.py from teoaivalis/InfluenceAnalyzerDemo: direct link, hf CLI and curl.
- Browser
- Download file 228 Bytes
-
https://huggingface.co/spaces/teoaivalis/InfluenceAnalyzerDemo/resolve/main/modules/ddg_search.py
- Command line
-
hf download hf://spaces/teoaivalis/InfluenceAnalyzerDemo/modules/ddg_search.py
-
curl -L -o ddg_search.py https://huggingface.co/spaces/teoaivalis/InfluenceAnalyzerDemo/resolve/main/modules/ddg_search.py
228 Bytes
| from duckduckgo_search import DDGS | |
| def search_images(prompt, max_results=10): | |
| with DDGS() as ddgs: | |
| results = ddgs.images(prompt, max_results=max_results) | |
| urls = [r['image'] for r in results] | |
| return urls | |