parthgupta1208 / PDF2PPTGenerator

PDF2PPT Generator is a Python tool that creates Powerpoint presentations from PDF files by using smart summarization techniques assisted by GPT-3.5-Turbo
MIT License
17 stars 8 forks source link

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

Open Versha111 opened 8 months ago

Versha111 commented 8 months ago

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

Versha111 commented 8 months ago

@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 commented 6 months ago

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