Spaces:
Sleeping
Sleeping
Commit ·
0e59558
1
Parent(s): 354c239
Moved prompt to the config file.
Browse files- .streamlit/config.toml +1 -0
- models/md_RAGDemo.py +1 -1
.streamlit/config.toml
CHANGED
|
@@ -16,6 +16,7 @@ chunk_size = 1000 # Size of text chunks
|
|
| 16 |
overlap = 180
|
| 17 |
num_chunks = 6
|
| 18 |
parser = ['\n\n', '\n', '(?<=\. )', ' ', '']
|
|
|
|
| 19 |
|
| 20 |
[MODELS]
|
| 21 |
embed_model = 'text-embedding-ada-002' # The model with which to create embeddings
|
|
|
|
| 16 |
overlap = 180
|
| 17 |
num_chunks = 6
|
| 18 |
parser = ['\n\n', '\n', '(?<=\. )', ' ', '']
|
| 19 |
+
prompt = "You are an experienced lawyer working for a large law firm. 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 simple terms that a person without legal experience can understand.\n\n{context}\n\nQuestion: {question}\nHelpful Answer:"
|
| 20 |
|
| 21 |
[MODELS]
|
| 22 |
embed_model = 'text-embedding-ada-002' # The model with which to create embeddings
|
models/md_RAGDemo.py
CHANGED
|
@@ -72,7 +72,7 @@ class LangUtils:
|
|
| 72 |
vs = st.session_state.chroma
|
| 73 |
llm = ChatOpenAI(model=self.cfg['MODELS']['openai_model'])
|
| 74 |
ret = vs.as_retriever(search_kwargs={"k": num_chunks})
|
| 75 |
-
prompt = PromptTemplate.from_template(
|
| 76 |
|
| 77 |
docs = ret.get_relevant_documents(question)
|
| 78 |
|
|
|
|
| 72 |
vs = st.session_state.chroma
|
| 73 |
llm = ChatOpenAI(model=self.cfg['MODELS']['openai_model'])
|
| 74 |
ret = vs.as_retriever(search_kwargs={"k": num_chunks})
|
| 75 |
+
prompt = PromptTemplate.from_template(self.cfg['DATA']['prompt'])
|
| 76 |
|
| 77 |
docs = ret.get_relevant_documents(question)
|
| 78 |
|