NicolasGaudemet
commited on
Commit
·
e35a59c
1
Parent(s):
37bdd2c
Update document_questioner_app.py
Browse files
document_questioner_app.py
CHANGED
@@ -2,15 +2,13 @@ import openai
|
|
2 |
import os
|
3 |
import gradio as gr
|
4 |
import chromadb
|
5 |
-
from langchain.document_loaders import
|
6 |
from langchain.embeddings.openai import OpenAIEmbeddings
|
7 |
from langchain.vectorstores import Chroma
|
8 |
from langchain.indexes import VectorstoreIndexCreator
|
9 |
-
from langchain.
|
10 |
-
from langchain.chains import RetrievalQA, RetrievalQAWithSourcesChain
|
11 |
from langchain.prompts import PromptTemplate
|
12 |
from langchain.chat_models import ChatOpenAI
|
13 |
-
from langchain.chains.question_answering import load_qa_chain
|
14 |
|
15 |
os.environ["OPENAI_API_KEY"] = "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"
|
16 |
|
|
|
2 |
import os
|
3 |
import gradio as gr
|
4 |
import chromadb
|
5 |
+
from langchain.document_loaders import PyPDFLoader
|
6 |
from langchain.embeddings.openai import OpenAIEmbeddings
|
7 |
from langchain.vectorstores import Chroma
|
8 |
from langchain.indexes import VectorstoreIndexCreator
|
9 |
+
from langchain.chains import RetrievalQAWithSourcesChain
|
|
|
10 |
from langchain.prompts import PromptTemplate
|
11 |
from langchain.chat_models import ChatOpenAI
|
|
|
12 |
|
13 |
os.environ["OPENAI_API_KEY"] = "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"
|
14 |
|