curiousily / ragbase

Completely local RAG. Chat with your PDF documents (with open LLM) and UI to that uses LangChain, Streamlit, Ollama (Llama 3.1), Qdrant and advanced methods like reranking and semantic chunking.
https://www.mlexpert.io/bootcamp/ragbase-local-rag
MIT License
55 stars 19 forks source link

groq api required #9

Open Esmail-ibraheem opened 2 months ago

Esmail-ibraheem commented 2 months ago

i says that need the groq api, why i am using ollama models Did not find groq_api_key, please add an environment variable GROQ_API_KEY which contains it, or pass groq_api_key as a named parameter. (type=value_error) Fetching 5 files: 100%|██████████████████████████████████████████████████████████████████████████| 5/5 [00:00<?, ?it/s] C:\Users\Esmail-Ata\AppData\Local\pypoetry\Cache\virtualenvs\ragbase-Tn2QGx_i-py3.12\Lib\site-packages\pypdfium2_helpers\textpage.py:80: UserWarning: get_text_range() call with default params will be implicitly redirected to get_text_bounded() warnings.warn("get_text_range() call with default params will be implicitly redirected to get_text_bounded()") 2024-09-22 15:26:56.295 Uncaught app exception Traceback (most recent call last): File "C:\Users\Esmail-Ata\AppData\Local\pypoetry\Cache\virtualenvs\ragbase-Tn2QGx_i-py3.12\Lib\site-packages\streamlit\runtime\scriptrunner\script_runner.py", line 589, in _run_script exec(code, module.dict) File "C:\ragbase\app.py", line 130, in chain = show_upload_documents() ^^^^^^^^^^^^^^^^^^^^^^^ File "C:\ragbase\app.py", line 75, in show_upload_documents return build_qa_chain(uploaded_files) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Esmail-Ata\AppData\Local\pypoetry\Cache\virtualenvs\ragbase-Tn2QGx_i-py3.12\Lib\site-packages\streamlit\runtime\caching\cache_utils.py", line 168, in wrapper return cached_func(*args, *kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Esmail-Ata\AppData\Local\pypoetry\Cache\virtualenvs\ragbase-Tn2QGx_i-py3.12\Lib\site-packages\streamlit\runtime\caching\cache_utils.py", line 199, in call return self._get_or_create_cached_value(args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Esmail-Ata\AppData\Local\pypoetry\Cache\virtualenvs\ragbase-Tn2QGx_i-py3.12\Lib\site-packages\streamlit\runtime\caching\cache_utils.py", line 224, in _get_or_create_cached_value return self._handle_cache_miss(cache, value_key, func_args, func_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\Esmail-Ata\AppData\Local\pypoetry\Cache\virtualenvs\ragbase-Tn2QGx_i-py3.12\Lib\site-packages\streamlit\runtime\caching\cache_utils.py", line 280, in _handle_cache_miss computed_value = self._info.func(func_args, **func_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\ragbase\app.py", line 34, in build_qa_chain llm = create_llm() ^^^^^^^^^^^^ File "C:\ragbase\ragbase\model.py", line 19, in create_llm return ChatGroq( ^^^^^^^^^ File "C:\Users\Esmail-Ata\AppData\Local\pypoetry\Cache\virtualenvs\ragbase-Tn2QGx_i-py3.12\Lib\site-packages\pydantic\v1\main.py", line 341, in init raise validation_error pydantic.v1.error_wrappers.ValidationError: 1 validation error for ChatGroq root Did not find groq_api_key, please add an environment variable GROQ_API_KEY which contains it, or pass groq_api_key as a named parameter. (type=value_error)

jsvnsk commented 1 month ago

try this: modify the file ./ragbase/config.py and set the value of USE_LOCAL to True