antimoda1 commited on
Commit ·
0f44486
1
Parent(s): a1e7d48
hotfix
Browse files
app.py
CHANGED
|
@@ -3,7 +3,7 @@ import gradio as gr
|
|
| 3 |
from generation import wrap_prompt
|
| 4 |
from llm import get_llm_answer
|
| 5 |
from retrieval import Retrieval
|
| 6 |
-
from _2_splitting import
|
| 7 |
from vocabulary.parse_vocabulary import parse_vocabulary
|
| 8 |
|
| 9 |
|
|
@@ -19,15 +19,8 @@ def perform_search(query, top_k, year_from, year_to):
|
|
| 19 |
|
| 20 |
# Преобразуем входные значения
|
| 21 |
try:
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
else:
|
| 25 |
-
year_from = int(year_from)
|
| 26 |
-
|
| 27 |
-
if year_to == 'N':
|
| 28 |
-
year_to = YEAR_NEW
|
| 29 |
-
else:
|
| 30 |
-
year_to = int(year_to)
|
| 31 |
|
| 32 |
# Проверяем корректность диапазона
|
| 33 |
if year_from > year_to:
|
|
|
|
| 3 |
from generation import wrap_prompt
|
| 4 |
from llm import get_llm_answer
|
| 5 |
from retrieval import Retrieval
|
| 6 |
+
from _2_splitting import _parse_single_year
|
| 7 |
from vocabulary.parse_vocabulary import parse_vocabulary
|
| 8 |
|
| 9 |
|
|
|
|
| 19 |
|
| 20 |
# Преобразуем входные значения
|
| 21 |
try:
|
| 22 |
+
year_from = _parse_single_year(year_from)
|
| 23 |
+
year_to = _parse_single_year(year_to)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
# Проверяем корректность диапазона
|
| 26 |
if year_from > year_to:
|