-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
43 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,19 @@ | ||
import os | ||
from megabots import bot | ||
from lcserve import serving | ||
from megabots.utils import create_api | ||
|
||
# from lcserve import serving | ||
|
||
cur_dir = os.path.dirname(os.path.abspath(__file__)) | ||
index_dir = os.path.join(cur_dir, "..", "examples", "files") | ||
|
||
print("hey") | ||
|
||
mybot = bot("qna-over-docs", index="./index.pkl") | ||
|
||
|
||
# @serving | ||
# def ask(question: str) -> str: | ||
# return mybot.ask(question) | ||
|
||
|
||
@serving | ||
def ask(question: str) -> str: | ||
mybot = bot("qna-over-docs", index=index_dir) | ||
return mybot.ask(question) | ||
app = create_api(mybot) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters