snippet_length=40*int(8/len(input_tokens))# * Change to another value?
snippet_length=40*int(10/len(input_tokens)+1)# * Change to another value?
# Loop through each input token.
fortokenininput_tokens:
@ -635,6 +671,9 @@ partycodes = list(party_colors.keys()) # List of partycodes
# Max hits returned by db.
return_limit=10000
# Initialize LLM model.
llama=LLM(temperature=0.5)
# Ask for word to search for.
user_input=st.text_input(
"",
@ -644,18 +683,17 @@ user_input = st.text_input(
help='You can use asterix (*), minus (-), quotationmarks ("") and OR.',
)
iflen(user_input)>3:
params.q=user_input
# print(user_input.upper())
# print(ollama(prompt=f'''A user wants to search in a database containing debates in the European Parliament and have made the input below. Take that input and write three questions would generate a good result if used for quering a vector database. Answer with a python style list containing the three questions.
# print(llama.generate(prompt=f'''A user wants to search in a database containing debates in the European Parliament and have made the input below. Take that input and write three questions would generate a good result if used for quering a vector database. Answer with a python style list containing the three questions.