Spaces:
Build error
Build error
Ilia Tambovtsev commited on
Commit Β·
188b538
1
Parent(s): ed34fc4
feat: configure params, add description
Browse files- src/webapp/app.py +10 -3
src/webapp/app.py
CHANGED
|
@@ -113,7 +113,7 @@ class RagInterface:
|
|
| 113 |
self.output_height = 500
|
| 114 |
|
| 115 |
def rate_response(self, score: float):
|
| 116 |
-
best_threshold = 0.
|
| 117 |
ok_threshold = 0.6
|
| 118 |
if score < best_threshold:
|
| 119 |
return "π" # "π―"
|
|
@@ -122,13 +122,20 @@ class RagInterface:
|
|
| 122 |
return "π"
|
| 123 |
|
| 124 |
def calculate_params(self, search_depth: int):
|
| 125 |
-
return
|
| 126 |
|
| 127 |
def launch(self, **kwargs):
|
| 128 |
"""Build Gradio interface layout"""
|
| 129 |
|
| 130 |
with gr.Blocks() as app:
|
| 131 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 132 |
|
| 133 |
with gr.Row():
|
| 134 |
# Input components
|
|
|
|
| 113 |
self.output_height = 500
|
| 114 |
|
| 115 |
def rate_response(self, score: float):
|
| 116 |
+
best_threshold = 0.42
|
| 117 |
ok_threshold = 0.6
|
| 118 |
if score < best_threshold:
|
| 119 |
return "π" # "π―"
|
|
|
|
| 122 |
return "π"
|
| 123 |
|
| 124 |
def calculate_params(self, search_depth: int):
|
| 125 |
+
return {1: 30, 2: 50, 3: 70, 4: 100, 5: 150}.get(search_depth, 70)
|
| 126 |
|
| 127 |
def launch(self, **kwargs):
|
| 128 |
"""Build Gradio interface layout"""
|
| 129 |
|
| 130 |
with gr.Blocks() as app:
|
| 131 |
+
# fmt: off
|
| 132 |
+
gr.Markdown(dedent(
|
| 133 |
+
"""\
|
| 134 |
+
# Presentation Search
|
| 135 |
+
[Link to benchmark](https://docs.google.com/spreadsheets/d/1qWRF_o-RY1x-o-3z08iVb2akh0HS3ZNxVkZi6yoVsI4/edit?usp=sharing)
|
| 136 |
+
""")
|
| 137 |
+
)
|
| 138 |
+
# fmt: on
|
| 139 |
|
| 140 |
with gr.Row():
|
| 141 |
# Input components
|