Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -45,6 +45,7 @@ def invoke(openai_api_key, youtube_url, process_video, prompt):
|
|
45 |
qa_chain = RetrievalQA.from_chain_type(llm, retriever = vector_db.as_retriever(search_kwargs = {"k": 3}), return_source_documents = True, chain_type_kwargs = {"prompt": QA_CHAIN_PROMPT})
|
46 |
result = qa_chain({"query": prompt})
|
47 |
#print(result)
|
|
|
48 |
return result["result"]
|
49 |
|
50 |
description = """<strong>Overview:</strong> The app demonstrates how to use a Large Language Model (LLM) with Retrieval Augmented Generation (RAG) on external data
|
@@ -70,4 +71,4 @@ demo = gr.Interface(fn=invoke,
|
|
70 |
outputs = [gr.Textbox(label = "Completion", lines = 1)],
|
71 |
title = "Generative AI - LLM & RAG",
|
72 |
description = description)
|
73 |
-
demo.launch()
|
|
|
45 |
qa_chain = RetrievalQA.from_chain_type(llm, retriever = vector_db.as_retriever(search_kwargs = {"k": 3}), return_source_documents = True, chain_type_kwargs = {"prompt": QA_CHAIN_PROMPT})
|
46 |
result = qa_chain({"query": prompt})
|
47 |
#print(result)
|
48 |
+
print(openai.api_key)
|
49 |
return result["result"]
|
50 |
|
51 |
description = """<strong>Overview:</strong> The app demonstrates how to use a Large Language Model (LLM) with Retrieval Augmented Generation (RAG) on external data
|
|
|
71 |
outputs = [gr.Textbox(label = "Completion", lines = 1)],
|
72 |
title = "Generative AI - LLM & RAG",
|
73 |
description = description)
|
74 |
+
demo.queue().launch()
|