Update app.py
Browse files
app.py
CHANGED
@@ -47,8 +47,10 @@ def invoke(openai_api_key, youtube_url, process_video, prompt):
|
|
47 |
#print(result)
|
48 |
return result["result"]
|
49 |
|
50 |
-
description = """<strong>Overview:</strong> The app demonstrates how to use a <strong>Large Language Model</strong> (LLM) with <strong>Retrieval Augmented Generation
|
51 |
-
(RAG) on external data (YouTube videos in this case, but it could be PDFs, URLs, databases,
|
|
|
|
|
52 |
<strong>Instructions:</strong> Enter an OpenAI API key, YouTube URL, and prompt to perform semantic search, sentiment analysis, summarization,
|
53 |
translation, etc. To ask multiple questions related to the same video, set "Process Video" to "True" on the first submission and then to "False".
|
54 |
The example is a 3:12 min. video about GPT-4 and takes less than 30 sec. to process. Experiment with different prompts, for example "what is gpt-4,
|
@@ -60,7 +62,7 @@ description = """<strong>Overview:</strong> The app demonstrates how to use a <s
|
|
60 |
|
61 |
gr.close_all()
|
62 |
demo = gr.Interface(fn=invoke,
|
63 |
-
inputs = [gr.Textbox(label = "OpenAI API Key", value = "sk-", lines = 1), gr.Textbox(label = "YouTube URL", value = "https://www.youtube.com/watch?v=--khbXchTeE", lines = 1), gr.Radio([True, False], label="Process Video", value =
|
64 |
outputs = [gr.Textbox(label = "Completion", lines = 1)],
|
65 |
title = "Generative AI - LLM & RAG",
|
66 |
description = description)
|
|
|
47 |
#print(result)
|
48 |
return result["result"]
|
49 |
|
50 |
+
description = """<strong>Overview:</strong> The app demonstrates how to use a <strong>Large Language Model</strong> (LLM) with <strong>Retrieval Augmented Generation
|
51 |
+
</strong> (RAG) on external data (YouTube videos in this case, but it could be PDFs, URLs, databases, or other
|
52 |
+
<a href='https://github.com/bstraehle/ai-ml-dl/blob/667f92d0a4cf2a35e2861faefe97d1f094cd79e2/langchain/langchain-document-loaders.png'>
|
53 |
+
structured/unstructured private/public data sources</a>).\n\n
|
54 |
<strong>Instructions:</strong> Enter an OpenAI API key, YouTube URL, and prompt to perform semantic search, sentiment analysis, summarization,
|
55 |
translation, etc. To ask multiple questions related to the same video, set "Process Video" to "True" on the first submission and then to "False".
|
56 |
The example is a 3:12 min. video about GPT-4 and takes less than 30 sec. to process. Experiment with different prompts, for example "what is gpt-4,
|
|
|
62 |
|
63 |
gr.close_all()
|
64 |
demo = gr.Interface(fn=invoke,
|
65 |
+
inputs = [gr.Textbox(label = "OpenAI API Key", value = "sk-", lines = 1), gr.Textbox(label = "YouTube URL", value = "https://www.youtube.com/watch?v=--khbXchTeE", lines = 1), gr.Radio([True, False], label="Process Video", value = False), gr.Textbox(label = "Prompt", value = "what is gpt-4", lines = 1)],
|
66 |
outputs = [gr.Textbox(label = "Completion", lines = 1)],
|
67 |
title = "Generative AI - LLM & RAG",
|
68 |
description = description)
|