diff --git a/ui/requirements.txt b/ui/requirements.txt index 20f85620e..7563be733 100644 --- a/ui/requirements.txt +++ b/ui/requirements.txt @@ -1,2 +1,2 @@ -streamlit==0.81.0 -st-annotated-text==1.0.1 \ No newline at end of file +streamlit==0.84.0 +st-annotated-text==1.1.0 diff --git a/ui/webapp.py b/ui/webapp.py index ceb2d7908..c630f9c82 100644 --- a/ui/webapp.py +++ b/ui/webapp.py @@ -22,8 +22,9 @@ def annotate_answer(answer, context): from the API that we highlight in the given context""" start_idx = context.find(answer) end_idx = start_idx + len(answer) - annotated_text(context[:start_idx], (answer, "ANSWER", "#8ef"), context[end_idx:]) - + # calculate dynamic height depending on context length + height = int(len(context) * 0.50) + 5 + annotated_text(context[:start_idx], (answer, "ANSWER", "#8ef"), context[end_idx:], height=height) def show_plain_documents(text): """ If we are using a plain document search pipeline, i.e. only retriever, we'll get plain documents