Skip to content
This repository has been archived by the owner on Oct 19, 2023. It is now read-only.

Commit

Permalink
fix(app): pdf qna playground
Browse files Browse the repository at this point in the history
  • Loading branch information
deepankarm committed Apr 24, 2023
1 parent 9be2856 commit e3e3c05
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions lcserve/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,5 +375,14 @@ def babyagi(verbose):
play(verbose=verbose)


@playground.command(help='Play with pdf qna on JCloud.')
def pdf_qna():
sys.path.append(os.path.join(os.path.dirname(__file__), 'playground', 'pdf_qna'))
from streamlit.web import cli as strcli

sys.argv = ['streamlit', 'run', 'lcserve/playground/pdf_qna/playground.py']
sys.exit(strcli.main())


if __name__ == "__main__":
serve()
4 changes: 2 additions & 2 deletions lcserve/playground/pdf_qna/playground.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class Response(BaseModel):
submit = st.button('Submit')


def main():
def play():
if submit:
if not openai_token:
st.error('Please enter your OpenAI token')
Expand Down Expand Up @@ -85,4 +85,4 @@ def main():


if __name__ == '__main__':
main()
play()

0 comments on commit e3e3c05

Please sign in to comment.