Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,7 @@ from langchain.text_splitter import RecursiveCharacterTextSplitter
|
|
7 |
from langchain.callbacks.manager import CallbackManager
|
8 |
from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler
|
9 |
from langchain.vectorstores import Qdrant
|
10 |
-
from
|
11 |
|
12 |
# Load the embedding model
|
13 |
encoder = SentenceTransformer('jinaai/jina-embedding-b-en-v1')
|
@@ -82,7 +82,7 @@ def chat(messages):
|
|
82 |
|
83 |
screen = gr.Interface(
|
84 |
fn=chat,
|
85 |
-
inputs=gr.
|
86 |
outputs="chatbot",
|
87 |
title="Q&A with PDFs π©π»βπ»πβπ»π‘",
|
88 |
description="This app facilitates a conversation with PDFs uploadedπ‘",
|
@@ -93,4 +93,4 @@ screen = gr.Interface(
|
|
93 |
)
|
94 |
|
95 |
# Add a way to upload and setup the database before starting the chat
|
96 |
-
screen.launch()
|
|
|
7 |
from langchain.callbacks.manager import CallbackManager
|
8 |
from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler
|
9 |
from langchain.vectorstores import Qdrant
|
10 |
+
from transformers import AutoModelForCausalLM
|
11 |
|
12 |
# Load the embedding model
|
13 |
encoder = SentenceTransformer('jinaai/jina-embedding-b-en-v1')
|
|
|
82 |
|
83 |
screen = gr.Interface(
|
84 |
fn=chat,
|
85 |
+
inputs=gr.Textbox(placeholder="Type your question here..."),
|
86 |
outputs="chatbot",
|
87 |
title="Q&A with PDFs π©π»βπ»πβπ»π‘",
|
88 |
description="This app facilitates a conversation with PDFs uploadedπ‘",
|
|
|
93 |
)
|
94 |
|
95 |
# Add a way to upload and setup the database before starting the chat
|
96 |
+
screen.launch()
|