You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import os
os.environ["HUGGINGFACE_ACCESS_TOKEN"] = "hf_token"
from embedchain import App
app = App.from_config("iwprog.yaml")
app.reset()
PDF_FILE = os.path.join(os.getcwd(), 'mypdf.pdf')
app.add(PDF_FILE)
All is ok to read pdf
prog3.chat.py:
import os
os.environ["HUGGINGFACE_ACCESS_TOKEN"] = "hf_token"
from embedchain import App
app = App.from_config(config={
"app": {
"config": {
# this will persist and load data from app1 session
"id": "my-appli-1",
}
}
})
while True:
user_input = input("Enter your question (type 'exit' to quit): ")
# Break the loop if the user types 'exit'
if user_input.lower() in ['q', 'exit', 'quit']:
break
# Process the input and provide a response
response = app.chat(user_input)
print(response)
I have an error:
Traceback (most recent call last):
File "E:\pythonProjects\ec_programs\prog3.chat.py", line 10, in <module>
app = App.from_config(config={
^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\pythonProjects\ec_programs\.venv\Lib\site-packages\embedchain\app.py", line 394, in from_config
embedding_model = EmbedderFactory.create(
^^^^^^^^^^^^^^^^^^^^^^^
File "E:\pythonProjects\ec_programs\.venv\Lib\site-packages\embedchain\factory.py", line 75, in create
return embedder_class(config=embedder_config_class(**config_data))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "E:\pythonProjects\ec_programs\.venv\Lib\site-packages\embedchain\embedder\openai.py", line 19, in __init__
api_key = self.config.api_key or os.environ["OPENAI_API_KEY"]
~~~~~~~~~~^^^^^^^^^^^^^^^^^^
File "<frozen os>", line 685, in __getitem__
KeyError: 'OPENAI_API_KEY'
The text was updated successfully, but these errors were encountered:
馃悰 Describe the bug
I try to share documents with no success with huggingface
iwprog.yaml:
addpdf.py:
All is ok to read pdf
prog3.chat.py:
I have an error:
The text was updated successfully, but these errors were encountered: