bstraehle commited on
Commit
00a6d73
·
1 Parent(s): c30d16c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -5
app.py CHANGED
@@ -78,11 +78,12 @@ def invoke(openai_api_key, use_rag, prompt):
78
  description = """<strong>Overview:</strong> The app demonstrates how to use a Large Language Model (LLM) with Retrieval Augmented Generation (RAG) on external data
79
  (YouTube videos, PDFs, URLs, or other <a href='https://raw.githubusercontent.com/bstraehle/ai-ml-dl/c38b224c196fc984aab6b6cc6bdc666f8f4fbcff/langchain/document-loaders.png'>data sources</a>).\n\n
80
  <strong>Instructions:</strong> Enter an OpenAI API key and perform LLM use cases (semantic search, summarization, translation, etc.) on
81
- <strong>YouTube videos about GPT-4</strong>, created after the GPT-4 training cutoff.
82
  <ul style="list-style-type:square;">
83
- <li>Set "Retrieval Augmented Generation" to "<strong>False</strong>" and submit prompt "Explain GPT-4". The LLM <strong>without</strong> RAG does not know the answer.</li>
84
- <li>Set "Retrieval Augmented Generation" to "<strong>True</strong>" and submit prompt "Explain GPT-4". The LLM <strong>with</strong> RAG knows the answer.</li>
85
- <li>Experiment with prompts, e.g. "Explain GPT-4 in one sentence in German", "List pros and cons of GPT-4", or "Write a Python program to call the GPT-4 API".</li>
 
86
  </ul>\n\n
87
  <strong>Technology:</strong> <a href='https://www.gradio.app/'>Gradio</a> UI using <a href='https://platform.openai.com/'>OpenAI</a> API via AI-first
88
  <a href='https://www.langchain.com/'>LangChain</a> toolkit with <a href='https://openai.com/research/whisper'>Whisper</a> (speech-to-text) and
@@ -93,7 +94,7 @@ gr.close_all()
93
  demo = gr.Interface(fn=invoke,
94
  inputs = [gr.Textbox(label = "OpenAI API Key", value = "sk-", lines = 1),
95
  gr.Radio([True, False], label="Retrieval Augmented Generation", value = False),
96
- gr.Textbox(label = "Prompt", value = "Explain GPT-4", lines = 1)],
97
  outputs = [gr.Textbox(label = "Completion", lines = 1)],
98
  title = "Generative AI - LLM & RAG",
99
  description = description)
 
78
  description = """<strong>Overview:</strong> The app demonstrates how to use a Large Language Model (LLM) with Retrieval Augmented Generation (RAG) on external data
79
  (YouTube videos, PDFs, URLs, or other <a href='https://raw.githubusercontent.com/bstraehle/ai-ml-dl/c38b224c196fc984aab6b6cc6bdc666f8f4fbcff/langchain/document-loaders.png'>data sources</a>).\n\n
80
  <strong>Instructions:</strong> Enter an OpenAI API key and perform LLM use cases (semantic search, summarization, translation, etc.) on
81
+ <strong>YouTube videos about GPT-4</strong>, created after its training cutoff.
82
  <ul style="list-style-type:square;">
83
+ <li>Set "Retrieval Augmented Generation" to "<strong>False</strong>" and submit prompt "What is GPT-4". The LLM <strong>without</strong> RAG does not know the answer.</li>
84
+ <li>Set "Retrieval Augmented Generation" to "<strong>True</strong>" and submit prompt "What is GPT-4". The LLM <strong>with</strong> RAG knows the answer.</li>
85
+ <li>Experiment with prompts, e.g. "What is GPT-4 in one sentence in German", "List pros and cons of GPT-4", or "Write a Python program to call the GPT-4 API".</li>
86
+ <li>Experiment some more, e.g. "Tell a joke about GPT-4", "Write a poem about GPT-4", or "Teach about prompt engineering".</li>
87
  </ul>\n\n
88
  <strong>Technology:</strong> <a href='https://www.gradio.app/'>Gradio</a> UI using <a href='https://platform.openai.com/'>OpenAI</a> API via AI-first
89
  <a href='https://www.langchain.com/'>LangChain</a> toolkit with <a href='https://openai.com/research/whisper'>Whisper</a> (speech-to-text) and
 
94
  demo = gr.Interface(fn=invoke,
95
  inputs = [gr.Textbox(label = "OpenAI API Key", value = "sk-", lines = 1),
96
  gr.Radio([True, False], label="Retrieval Augmented Generation", value = False),
97
+ gr.Textbox(label = "Prompt", value = "What is GPT-4", lines = 1)],
98
  outputs = [gr.Textbox(label = "Completion", lines = 1)],
99
  title = "Generative AI - LLM & RAG",
100
  description = description)