PDF2PPTGenerator icon indicating copy to clipboard operation
PDF2PPTGenerator copied to clipboard

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

Open Versha111 opened this issue 1 year ago • 3 comments

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

Versha111 avatar Apr 04 '24 07:04 Versha111

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 avatar Apr 04 '24 07:04 abhijeet-shankar

@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 avatar Apr 04 '24 11:04 Versha111

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

parthgupta1208 avatar May 18 '24 13:05 parthgupta1208