Spaces:
Sleeping
Sleeping
Cédric KACZMAREK
commited on
Commit
·
0a890f4
1
Parent(s):
70b87af
Correction add ajout chemin pour l'image
Browse files
app.py
CHANGED
|
@@ -15,6 +15,8 @@ from llama_index.embeddings.mistralai import MistralAIEmbedding
|
|
| 15 |
from llama_index.vector_stores.chroma import ChromaVectorStore
|
| 16 |
from llama_index.core.indices.service_context import ServiceContext
|
| 17 |
|
|
|
|
|
|
|
| 18 |
TITLE = "RIZOA-AUCHAN Chatbot Demo"
|
| 19 |
DESCRIPTION = "Example of an assistant with Gradio, coupling with function calling and Mistral AI via its API"
|
| 20 |
PLACEHOLDER = (
|
|
@@ -42,18 +44,22 @@ service_context = ServiceContext.from_defaults(
|
|
| 42 |
chunk_size=1024, llm=llm, embed_model=embed_model
|
| 43 |
)
|
| 44 |
|
| 45 |
-
PDFReader = download_loader("PDFReader")
|
| 46 |
-
loader = PDFReader()
|
| 47 |
|
| 48 |
index = VectorStoreIndex(
|
| 49 |
[], service_context=service_context, storage_context=storage_context
|
| 50 |
)
|
| 51 |
query_engine = index.as_query_engine(similarity_top_k=5)
|
| 52 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
with gr.Blocks() as demo:
|
| 54 |
with gr.Row():
|
| 55 |
with gr.Column(scale=1):
|
| 56 |
-
gr.Image(value="
|
| 57 |
height=250,
|
| 58 |
width=250,
|
| 59 |
container=False,
|
|
|
|
| 15 |
from llama_index.vector_stores.chroma import ChromaVectorStore
|
| 16 |
from llama_index.core.indices.service_context import ServiceContext
|
| 17 |
|
| 18 |
+
from pathlib import path
|
| 19 |
+
|
| 20 |
TITLE = "RIZOA-AUCHAN Chatbot Demo"
|
| 21 |
DESCRIPTION = "Example of an assistant with Gradio, coupling with function calling and Mistral AI via its API"
|
| 22 |
PLACEHOLDER = (
|
|
|
|
| 44 |
chunk_size=1024, llm=llm, embed_model=embed_model
|
| 45 |
)
|
| 46 |
|
| 47 |
+
#PDFReader = download_loader("PDFReader")
|
| 48 |
+
#loader = PDFReader()
|
| 49 |
|
| 50 |
index = VectorStoreIndex(
|
| 51 |
[], service_context=service_context, storage_context=storage_context
|
| 52 |
)
|
| 53 |
query_engine = index.as_query_engine(similarity_top_k=5)
|
| 54 |
|
| 55 |
+
FILE = Path(__file__).resolve()
|
| 56 |
+
BASE_PATH = FILE.parents[1]
|
| 57 |
+
|
| 58 |
+
|
| 59 |
with gr.Blocks() as demo:
|
| 60 |
with gr.Row():
|
| 61 |
with gr.Column(scale=1):
|
| 62 |
+
gr.Image(value=os.path.join(BASE_PATH,"img/logo_rizoa_auchan.jpg"),
|
| 63 |
height=250,
|
| 64 |
width=250,
|
| 65 |
container=False,
|