Download app.py from gowthM23/_: direct link, hf CLI and curl.
- Browser
- Download file 508 Bytes
-
https://huggingface.co/spaces/gowthM23/_/resolve/main/app.py
- Command line
-
hf download hf://spaces/gowthM23/_/app.py
-
curl -L -o app.py https://huggingface.co/spaces/gowthM23/_/resolve/main/app.py
508 Bytes
| import streamlit as st | |
| from duckduckgo_search import DDGS | |
| def search_images(term, max_images=5): | |
| results = DDGS().images(term, max_results=max_images) | |
| return [result['image'] for result in results] | |
| st.title("DuckDuckGo Image Search") | |
| search_term = st.text_input("Enter search term:") | |
| if search_term: | |
| urls = search_images(search_term) | |
| if urls: | |
| st.write(f"Found {len(urls)} images.") | |
| for url in urls: | |
| st.image(url) | |
| else: | |
| st.write("No images found.") | |