Open Versha111 opened 8 months ago
Use bing-image-downloader or google_images_download, that downloads from Bing,Google search engine.
Steps:(for Bing)
Step 1: Install the library by using: pip install bing-image-downloader
Step 2: (Sample)
from bing_image_downloader.downloader import download
query_string = 'AddQuery'
download(query_string, limit=1000, output_dir='dataset', adult_filter_off=True, force_replace=False, timeout=60, verbose=True)
That's it! All you would need to do is to add your image topic to the query_string and modify the functions as needed. Note: API method is recommended for accurate results.
@abhijeet-shankar @parthgupta1208 @Sounacc also I'd like to integrate a local language model (LLM) into this file instead of the gpt.py file. Could you please provide the Python file and instructions for incorporating it into the prompt for summarization?
@Versha111 You can simply install ollama and run a local llama-70b, call it directly in a python file using langchain and recieve its output where you are retrieving the gpt output as of now
from langchain_community.llms import Ollama
llm = Ollama(model="llama2")
def gpt_call(user_prompt):
return llm.invoke(user_prompt)
Feel free to contact for relevant info ...
@parthgupta1208 @abhijeet-shankar @Sounacc I intend to run this locally without relying on API keys for both the Google Image Search API and the Google Cloud Vision API. Could you elaborate on the substitute for the addphoto.py file?