bstraehle commited on
Commit
5ba6f5c
·
1 Parent(s): 3764a07

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -34,7 +34,8 @@ YOUTUBE_DIR = "/data/youtube"
34
 
35
  PDF_URL = "https://arxiv.org/pdf/2303.08774.pdf"
36
  WEB_URL_1 = "https://openai.com/research/gpt-4"
37
- WEB_URL_2 = "https://platform.openai.com/docs/api-reference"
 
38
  YOUTUBE_URL_1 = "https://www.youtube.com/watch?v=--khbXchTeE"
39
  YOUTUBE_URL_2 = "https://www.youtube.com/watch?v=hdhZwyf24mE"
40
  YOUTUBE_URL_3 = "https://www.youtube.com/watch?v=vw-KWfKwvTQ"
@@ -56,6 +57,8 @@ def invoke(openai_api_key, use_rag, prompt):
56
  #docs.extend(loader.load())
57
  #loader = WebBaseLoader(WEB_URL_2)
58
  #docs.extend(loader.load())
 
 
59
  # Load YouTube
60
  #loader = GenericLoader(YoutubeAudioLoader([YOUTUBE_URL_1,
61
  # YOUTUBE_URL_2,
@@ -87,7 +90,7 @@ def invoke(openai_api_key, use_rag, prompt):
87
  description = """<strong>Overview:</strong> The app demonstrates how to use a <strong>Large Language Model (LLM)</strong> with <strong>Retrieval Augmented Generation (RAG)</strong>
88
  on <strong>external data</strong> (private/public & structured/unstructured).\n\n
89
  <strong>Instructions:</strong> Enter an OpenAI API key and perform LLM use cases (semantic search, summarization, translation, etc.) on
90
- <a href='""" + YOUTUBE_URL_1 + """'>YouTube</a>, <a href='""" + PDF_URL + """'>PDF</a>, and <a href='""" + WEB_URL + """'>Web</a>
91
  <strong>GPT-4 data</strong> (created after training cutoff).
92
  <ul style="list-style-type:square;">
93
  <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>
@@ -96,7 +99,7 @@ description = """<strong>Overview:</strong> The app demonstrates how to use a <s
96
  <li>Experiment more, for example "Write a Python program calling the GPT-4 API." or "Write a Node.js program calling the GPT-4 API."</li>
97
  </ul>\n\n
98
  <strong>Technology:</strong> <a href='https://www.gradio.app/'>Gradio</a> UI using <a href='https://openai.com/'>OpenAI</a> API via AI-first
99
- <a href='https://www.langchain.com/'>LangChain</a> toolkit with <a href='""" + WEB_URL + """'>GPT-4</a> foundation model and AI-native
100
  <a href='https://www.trychroma.com/'>Chroma</a> embedding database."""
101
 
102
  gr.close_all()
 
34
 
35
  PDF_URL = "https://arxiv.org/pdf/2303.08774.pdf"
36
  WEB_URL_1 = "https://openai.com/research/gpt-4"
37
+ WEB_URL_2 = "https://platform.openai.com/docs/introduction"
38
+ WEB_URL_3 = "https://platform.openai.com/docs/api-reference"
39
  YOUTUBE_URL_1 = "https://www.youtube.com/watch?v=--khbXchTeE"
40
  YOUTUBE_URL_2 = "https://www.youtube.com/watch?v=hdhZwyf24mE"
41
  YOUTUBE_URL_3 = "https://www.youtube.com/watch?v=vw-KWfKwvTQ"
 
57
  #docs.extend(loader.load())
58
  #loader = WebBaseLoader(WEB_URL_2)
59
  #docs.extend(loader.load())
60
+ #loader = WebBaseLoader(WEB_URL_3)
61
+ #docs.extend(loader.load())
62
  # Load YouTube
63
  #loader = GenericLoader(YoutubeAudioLoader([YOUTUBE_URL_1,
64
  # YOUTUBE_URL_2,
 
90
  description = """<strong>Overview:</strong> The app demonstrates how to use a <strong>Large Language Model (LLM)</strong> with <strong>Retrieval Augmented Generation (RAG)</strong>
91
  on <strong>external data</strong> (private/public & structured/unstructured).\n\n
92
  <strong>Instructions:</strong> Enter an OpenAI API key and perform LLM use cases (semantic search, summarization, translation, etc.) on
93
+ <a href='""" + YOUTUBE_URL_1 + """'>YouTube</a>, <a href='""" + PDF_URL + """'>PDF</a>, and <a href='""" + WEB_URL_1 + """'>Web</a>
94
  <strong>GPT-4 data</strong> (created after training cutoff).
95
  <ul style="list-style-type:square;">
96
  <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>
 
99
  <li>Experiment more, for example "Write a Python program calling the GPT-4 API." or "Write a Node.js program calling the GPT-4 API."</li>
100
  </ul>\n\n
101
  <strong>Technology:</strong> <a href='https://www.gradio.app/'>Gradio</a> UI using <a href='https://openai.com/'>OpenAI</a> API via AI-first
102
+ <a href='https://www.langchain.com/'>LangChain</a> toolkit with <a href='""" + WEB_URL_1 + """'>GPT-4</a> foundation model and AI-native
103
  <a href='https://www.trychroma.com/'>Chroma</a> embedding database."""
104
 
105
  gr.close_all()