Spaces:
Runtime error
Runtime error
changed default splitting to false
Browse files
app.py
CHANGED
@@ -29,7 +29,8 @@ with st.sidebar:
|
|
29 |
st.write(f"Injected documents: \n\n {'\n'.join('\n'+file for file in files)}")
|
30 |
model = st.selectbox("Model name", ["gpt-3.5-turbo"], disabled=True)
|
31 |
temperature = st.number_input("Temperature", value=0.0, min_value=0.0, step=0.2, max_value=1.0, placeholder=0.0)
|
32 |
-
|
|
|
33 |
chunk_size = st.number_input("Chunk size", value=750, step=250, placeholder=750) # Defines the chunks in amount of tokens in which the files are split. Also defines the amount of tokens that are feeded into the context.
|
34 |
chunk_overlap = st.number_input("Chunk overlap", value=0, step=10, placeholder=0)
|
35 |
text_splitter = RecursiveCharacterTextSplitter(chunk_size=chunk_size, chunk_overlap=chunk_overlap)
|
@@ -53,7 +54,7 @@ Answer:
|
|
53 |
""" # Source: hub.pull("rlm/rag-prompt")
|
54 |
|
55 |
# (1) Retriever
|
56 |
-
retriever = vectorstore.as_retriever()
|
57 |
|
58 |
# (2) Prompt
|
59 |
prompt = ChatPromptTemplate.from_template(prompt_template)
|
@@ -100,7 +101,7 @@ c = st.container()
|
|
100 |
c.write("Beispielfragen")
|
101 |
col1, col2, col3 = c.columns(3)
|
102 |
col1.button("Mehr zu 'Lernen'", on_click=click_button, args=["Was macht die Säule 'Lernen' aus?"])
|
103 |
-
col1.button("
|
104 |
col2.button("Mehr zu 'Tracken'", on_click=click_button, args=["Was macht die Säule 'Tracken' aus?"])
|
105 |
col2.button("Welche Krankenkassen erstatten die App?", on_click=click_button, args=["Welche Krankenkassen erstatten die App?"])
|
106 |
col3.button("Mehr zu 'Handeln'", on_click=click_button, args=["Was macht die Säule 'Handeln' aus?"])
|
|
|
29 |
st.write(f"Injected documents: \n\n {'\n'.join('\n'+file for file in files)}")
|
30 |
model = st.selectbox("Model name", ["gpt-3.5-turbo"], disabled=True)
|
31 |
temperature = st.number_input("Temperature", value=0.0, min_value=0.0, step=0.2, max_value=1.0, placeholder=0.0)
|
32 |
+
k = st.number_input("Number of documents to include", value=1, min_value=1, step=1, placeholder=1)
|
33 |
+
if st.toggle("Splitting", value=False):
|
34 |
chunk_size = st.number_input("Chunk size", value=750, step=250, placeholder=750) # Defines the chunks in amount of tokens in which the files are split. Also defines the amount of tokens that are feeded into the context.
|
35 |
chunk_overlap = st.number_input("Chunk overlap", value=0, step=10, placeholder=0)
|
36 |
text_splitter = RecursiveCharacterTextSplitter(chunk_size=chunk_size, chunk_overlap=chunk_overlap)
|
|
|
54 |
""" # Source: hub.pull("rlm/rag-prompt")
|
55 |
|
56 |
# (1) Retriever
|
57 |
+
retriever = vectorstore.as_retriever(search_type="similarity_score_threshold", search_kwargs={"score_threshold": 0.3, "k": k})
|
58 |
|
59 |
# (2) Prompt
|
60 |
prompt = ChatPromptTemplate.from_template(prompt_template)
|
|
|
101 |
c.write("Beispielfragen")
|
102 |
col1, col2, col3 = c.columns(3)
|
103 |
col1.button("Mehr zu 'Lernen'", on_click=click_button, args=["Was macht die Säule 'Lernen' aus?"])
|
104 |
+
col1.button("Was macht die Volker-App?", on_click=click_button, args=["Was macht die Volker-App?"])
|
105 |
col2.button("Mehr zu 'Tracken'", on_click=click_button, args=["Was macht die Säule 'Tracken' aus?"])
|
106 |
col2.button("Welche Krankenkassen erstatten die App?", on_click=click_button, args=["Welche Krankenkassen erstatten die App?"])
|
107 |
col3.button("Mehr zu 'Handeln'", on_click=click_button, args=["Was macht die Säule 'Handeln' aus?"])
|