Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,7 +8,7 @@ from langchain_community.document_loaders import YoutubeLoader, UnstructuredPDFL
|
|
| 8 |
from langchain_community.document_loaders import OnlinePDFLoader
|
| 9 |
import json
|
| 10 |
|
| 11 |
-
def run_workflow(message,language='en'):
|
| 12 |
try:
|
| 13 |
if not message.get('text',''):
|
| 14 |
file = message['files'][0]
|
|
@@ -44,7 +44,7 @@ def run_workflow(message,language='en'):
|
|
| 44 |
"knowledge": raw_text
|
| 45 |
}
|
| 46 |
|
| 47 |
-
yield raw_text, "loading...", {}
|
| 48 |
|
| 49 |
# APIエンドポイントURL
|
| 50 |
url = DIFY_BASE_URL + "/workflows/run"
|
|
@@ -95,7 +95,8 @@ def run_workflow(message,language='en'):
|
|
| 95 |
iface = gr.Interface(
|
| 96 |
fn=run_workflow,
|
| 97 |
inputs=[gr.MultimodalTextbox(label="PDFファイルをアップロード", file_types=[".pdf"], interactive=True),
|
| 98 |
-
gr.Dropdown(label="Language",value="ja",choices=["en","en-US", "ja", "fr","de","it"],allow_custom_value=True)
|
|
|
|
| 99 |
outputs=[
|
| 100 |
gr.Textbox(label="生テキスト", show_copy_button=True, max_lines=5),
|
| 101 |
gr.Markdown(),
|
|
|
|
| 8 |
from langchain_community.document_loaders import OnlinePDFLoader
|
| 9 |
import json
|
| 10 |
|
| 11 |
+
def run_workflow(message,language='en',login=""):
|
| 12 |
try:
|
| 13 |
if not message.get('text',''):
|
| 14 |
file = message['files'][0]
|
|
|
|
| 44 |
"knowledge": raw_text
|
| 45 |
}
|
| 46 |
|
| 47 |
+
yield raw_text, "loading...", {"login":login}
|
| 48 |
|
| 49 |
# APIエンドポイントURL
|
| 50 |
url = DIFY_BASE_URL + "/workflows/run"
|
|
|
|
| 95 |
iface = gr.Interface(
|
| 96 |
fn=run_workflow,
|
| 97 |
inputs=[gr.MultimodalTextbox(label="PDFファイルをアップロード", file_types=[".pdf"], interactive=True),
|
| 98 |
+
gr.Dropdown(label="Language",value="ja",choices=["en","en-US", "ja", "fr","de","it"],allow_custom_value=True),
|
| 99 |
+
gr.LoginButton(),
|
| 100 |
outputs=[
|
| 101 |
gr.Textbox(label="生テキスト", show_copy_button=True, max_lines=5),
|
| 102 |
gr.Markdown(),
|