0

I keep seeing examples of calling OpenAI API, but i am using LLM llama2 and i am not interested to use OpenAI API, why OpenAI package is required for the following PromptHelper and LLMPredictor import, the modules supposedly come from llama_index, why openai is required?

from llama_index import SimpleDirectoryReader, VectorStoreIndex, PromptHelper, LLMPredictor

Secondly; Is there alternative to write below without using OpenAI?

prompt_helper = PromptHelper(max_input_size, num_outputs, max_chunk_overlap, chunk_size_limit=chunk_size_limit)

    llm_predictor = LLMPredictor(llm=ChatOpenAI(temperature=0.7, model_name="gpt-3.5-turbo", max_tokens=num_outputs))

I can't get past the openai things here.

mce
  • 1
  • 2

1 Answers1

0

OpenAi is not free to use yet. Instead there are many alternatives. You can use HuggingFace hub as an alternative. There are tutorials available on the YouTube, you can also check this website: https://medium.com/the-techlife/using-huggingface-openai-and-cohere-models-with-langchain-db57af14ac5b

You can use this example to see how huggingface is used as an alternative to openai