Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -137,14 +137,12 @@ def invoke(openai_api_key, rag_option, prompt):
|
|
137 |
db = document_retrieval_chroma(llm, prompt)
|
138 |
completion = rag_chain(llm, prompt, db)
|
139 |
result = completion["result"]
|
140 |
-
completion = completion.toJSON()
|
141 |
elif (rag_option == "MongoDB"):
|
142 |
#splits = document_loading_splitting()
|
143 |
#document_storage_mongodb(splits)
|
144 |
db = document_retrieval_mongodb(llm, prompt)
|
145 |
completion = rag_chain(llm, prompt, db)
|
146 |
result = completion["result"]
|
147 |
-
completion = completion.toJSON()
|
148 |
else:
|
149 |
result = llm_chain(llm, prompt)
|
150 |
completion = result
|
@@ -155,7 +153,7 @@ def invoke(openai_api_key, rag_option, prompt):
|
|
155 |
|
156 |
description = """<strong>Overview:</strong> Context-aware multimodal reasoning application that demonstrates a <strong>large language model (LLM)</strong> with
|
157 |
<strong>retrieval augmented generation (RAG)</strong>.
|
158 |
-
See <a href='https://
|
159 |
<strong>Instructions:</strong> Enter an OpenAI API key and perform text generation use cases on <a href='""" + YOUTUBE_URL_1 + """'>YouTube</a>,
|
160 |
<a href='""" + PDF_URL + """'>PDF</a>, and <a href='""" + WEB_URL + """'>web</a> data published after LLM knowledge cutoff (example: GPT-4 data).
|
161 |
<ul style="list-style-type:square;">
|
|
|
137 |
db = document_retrieval_chroma(llm, prompt)
|
138 |
completion = rag_chain(llm, prompt, db)
|
139 |
result = completion["result"]
|
|
|
140 |
elif (rag_option == "MongoDB"):
|
141 |
#splits = document_loading_splitting()
|
142 |
#document_storage_mongodb(splits)
|
143 |
db = document_retrieval_mongodb(llm, prompt)
|
144 |
completion = rag_chain(llm, prompt, db)
|
145 |
result = completion["result"]
|
|
|
146 |
else:
|
147 |
result = llm_chain(llm, prompt)
|
148 |
completion = result
|
|
|
153 |
|
154 |
description = """<strong>Overview:</strong> Context-aware multimodal reasoning application that demonstrates a <strong>large language model (LLM)</strong> with
|
155 |
<strong>retrieval augmented generation (RAG)</strong>.
|
156 |
+
See <a href='https://huggingface.co/spaces/bstraehle/openai-llm-rag/blob/main/openai-llm-rag.png'>architecture diagram</a>.\n\n
|
157 |
<strong>Instructions:</strong> Enter an OpenAI API key and perform text generation use cases on <a href='""" + YOUTUBE_URL_1 + """'>YouTube</a>,
|
158 |
<a href='""" + PDF_URL + """'>PDF</a>, and <a href='""" + WEB_URL + """'>web</a> data published after LLM knowledge cutoff (example: GPT-4 data).
|
159 |
<ul style="list-style-type:square;">
|