download spacy model
Browse files
app.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
import gradio
|
2 |
import gradio as gr
|
|
|
3 |
from langchain.chains import RetrievalQA
|
4 |
from langchain.text_splitter import SpacyTextSplitter
|
5 |
from langchain_community.document_loaders import PyPDFLoader
|
@@ -8,6 +9,8 @@ from langchain_community.vectorstores import Chroma
|
|
8 |
from langchain_core.prompts import PromptTemplate
|
9 |
from langchain_google_genai import ChatGoogleGenerativeAI
|
10 |
|
|
|
|
|
11 |
template = """Use the following pieces of context to answer the question at the end. If you don't know the answer, just say that you don't know, don't try to make up an answer. Use three sentences maximum. Keep the answer as concise as possible. Always say "thanks for asking!" at the end of the answer.
|
12 |
Tips: Make sure to cite your sources, and use the exact words from the context.
|
13 |
{context}
|
|
|
1 |
import gradio
|
2 |
import gradio as gr
|
3 |
+
import spacy
|
4 |
from langchain.chains import RetrievalQA
|
5 |
from langchain.text_splitter import SpacyTextSplitter
|
6 |
from langchain_community.document_loaders import PyPDFLoader
|
|
|
9 |
from langchain_core.prompts import PromptTemplate
|
10 |
from langchain_google_genai import ChatGoogleGenerativeAI
|
11 |
|
12 |
+
spacy.cli.download("en_core_web_sm")
|
13 |
+
|
14 |
template = """Use the following pieces of context to answer the question at the end. If you don't know the answer, just say that you don't know, don't try to make up an answer. Use three sentences maximum. Keep the answer as concise as possible. Always say "thanks for asking!" at the end of the answer.
|
15 |
Tips: Make sure to cite your sources, and use the exact words from the context.
|
16 |
{context}
|