Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exploring Local Execution Without API Keys: A Query into Alternatives for addphoto.py #2

Open
Versha111 opened this issue Apr 4, 2024 · 3 comments

Comments

@Versha111
Copy link

@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?

@abhijeet-shankar
Copy link
Collaborator

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.

@Versha111
Copy link
Author

@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?

@parthgupta1208
Copy link
Owner

@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)

This thread might help you

Feel free to contact for relevant info ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants