Skip to content

Commit

Permalink
Fix minors problems
Browse files Browse the repository at this point in the history
  • Loading branch information
JCH97 committed May 14, 2022
1 parent e558aea commit dbf3782
Show file tree
Hide file tree
Showing 27 changed files with 1,471 additions and 1,384 deletions.
3 changes: 3 additions & 0 deletions engine/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions engine/.idea/engine.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions engine/.idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions engine/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions engine/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions engine/.idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added engine/__pycache__/irm.cpython-38.pyc
Binary file not shown.
Binary file added engine/__pycache__/main.cpython-38.pyc
Binary file not shown.
Binary file added engine/__pycache__/pipeline.cpython-38.pyc
Binary file not shown.
Binary file added engine/__pycache__/scaner.cpython-38.pyc
Binary file not shown.
25 changes: 14 additions & 11 deletions engine/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
from fastapi.responses import RedirectResponse, FileResponse, HTMLResponse
from pipeline import Pipeline
from fastapi.middleware.cors import CORSMiddleware
from pydantic import BaseModel

app = FastAPI()

origins = [
"http://localhost",
"http://localhost:8080",
"http://localhost:8081",
]
class Item(BaseModel):
path: str


app = FastAPI()

app.add_middleware(
CORSMiddleware,
allow_origins=origins,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
Expand All @@ -27,15 +27,18 @@

@app.get("/", response_class=FileResponse)
def read_index(request: Request):
pipeline = Pipeline('')
pipeline.start()

path = 'static/index.html'
return FileResponse(path)


@app.post("/corpus")
async def set_corpus(path: Item):
print(path.path)
pipeline = Pipeline(path)
pipeline.start()


@app.get("/query")
def query_docs(value: str = ""):
pipeline.process_query(value)

return pipeline.retrive_docs()

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit dbf3782

Please sign in to comment.