Omar ID EL MOUMEN
commited on
Commit
·
e4180e5
1
Parent(s):
fe50e7f
Test non-redundent init finders
Browse files
app.py
CHANGED
@@ -220,6 +220,8 @@ class SpecDocFinder:
|
|
220 |
_, spec_url = version_found
|
221 |
return spec_url if version_found is not None else f"Specification {doc_id} not found"
|
222 |
|
|
|
|
|
223 |
|
224 |
@app.get("/")
|
225 |
async def main_menu():
|
@@ -228,7 +230,7 @@ async def main_menu():
|
|
228 |
@app.post("/find", response_model=DocResponse)
|
229 |
def find_document(request: DocRequest):
|
230 |
start_time = time.time()
|
231 |
-
finder =
|
232 |
print(finder)
|
233 |
|
234 |
result = finder.search_document(request.doc_id, request.release)
|
|
|
220 |
_, spec_url = version_found
|
221 |
return spec_url if version_found is not None else f"Specification {doc_id} not found"
|
222 |
|
223 |
+
finder_tsg = TsgDocFinder()
|
224 |
+
finder_spec = SpecDocFinder()
|
225 |
|
226 |
@app.get("/")
|
227 |
async def main_menu():
|
|
|
230 |
@app.post("/find", response_model=DocResponse)
|
231 |
def find_document(request: DocRequest):
|
232 |
start_time = time.time()
|
233 |
+
finder = finder_tsg if request.doc_id[0].isalpha() else finder_spec
|
234 |
print(finder)
|
235 |
|
236 |
result = finder.search_document(request.doc_id, request.release)
|