import gradio as gr from pipe import pipe import pytz import datetime import json def run(text): now = datetime.datetime.now(pytz.timezone('Asia/Tokyo')) print('\ntext:',text,now) result = pipe.run({ 'retrieve_prompt_builder':{'text':text}, 'prompt_builder':{'text':text} },include_outputs_from=['embedding_retriever','parser']) for document in result['embedding_retriever']['documents']: print(document.score,document.id) print(document.content) parsed = result['parser']['parsed'] print(parsed) return json.dumps(parsed,indent=2,ensure_ascii=False) title = '日本語 明確さ判定' with gr.Blocks(title=title,css_paths='./app.css') as app: gr.HTML(f'