bstraehle commited on
Commit
9e5685a
·
verified ·
1 Parent(s): f629c13

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -10,8 +10,8 @@ _ = load_dotenv(find_dotenv())
10
  RAG_INGESTION = False # load, split, embed, and store documents
11
 
12
  RAG_OFF = "Off"
13
- RAG_LANGCHAIN = "LangChain"
14
- RAG_LLAMAINDEX = "LlamaIndex"
15
 
16
  config = {
17
  "chunk_overlap": 100, # split documents
@@ -76,15 +76,15 @@ demo = gr.Interface(
76
  fn = invoke,
77
  inputs = [gr.Textbox(label = "OpenAI API Key", type = "password", lines = 1),
78
  gr.Textbox(label = "Prompt", value = "List GPT-4's exam scores and benchmark results.", lines = 1),
79
- gr.Radio([RAG_OFF, RAG_LANGCHAIN, RAG_LLAMAINDEX], label = "Retrieval-Augmented Generation", value = RAG_LANGCHAIN)],
80
  outputs = [gr.Textbox(label = "Completion")],
81
  title = "Context-Aware Reasoning Application",
82
  description = os.environ["DESCRIPTION"],
83
- examples = [["sk-<BringYourOwn>", "What are GPT-4's media capabilities in 5 emojis and 1 sentence?", RAG_LLAMAINDEX],
84
- ["sk-<BringYourOwn>", "List GPT-4's exam scores and benchmark results.", RAG_LANGCHAIN],
85
- ["sk-<BringYourOwn>", "Compare GPT-4 to GPT-3.5 in markdown table format.", RAG_LLAMAINDEX],
86
- ["sk-<BringYourOwn>", "Write a Python program that calls the GPT-4 API.", RAG_LANGCHAIN],
87
- ["sk-<BringYourOwn>", "What is the GPT-4 API's cost and rate limit? Answer in English, Arabic, Chinese, Hindi, and Russian in JSON format.", RAG_LLAMAINDEX]],
88
  cache_examples = False
89
  )
90
 
 
10
  RAG_INGESTION = False # load, split, embed, and store documents
11
 
12
  RAG_OFF = "Off"
13
+ RAG_NAIVE = "Naive RAG"
14
+ RAG_ADVANCED = "Advanced RAG"
15
 
16
  config = {
17
  "chunk_overlap": 100, # split documents
 
76
  fn = invoke,
77
  inputs = [gr.Textbox(label = "OpenAI API Key", type = "password", lines = 1),
78
  gr.Textbox(label = "Prompt", value = "List GPT-4's exam scores and benchmark results.", lines = 1),
79
+ gr.Radio([RAG_OFF, RAG_NAIVE, RAG_ADVANCED], label = "Retrieval-Augmented Generation", value = RAG_ADVANCED)],
80
  outputs = [gr.Textbox(label = "Completion")],
81
  title = "Context-Aware Reasoning Application",
82
  description = os.environ["DESCRIPTION"],
83
+ examples = [["sk-<BringYourOwn>", "What are GPT-4's media capabilities in 5 emojis and 1 sentence?", RAG_ADVANCED],
84
+ ["sk-<BringYourOwn>", "List GPT-4's exam scores and benchmark results.", RAG_ADVANCED],
85
+ ["sk-<BringYourOwn>", "Compare GPT-4 to GPT-3.5 in markdown table format.", RAG_ADVANCED],
86
+ ["sk-<BringYourOwn>", "Write a Python program that calls the GPT-4 API.", RAG_ADVANCED],
87
+ ["sk-<BringYourOwn>", "What is the GPT-4 API's cost and rate limit? Answer in English, Arabic, Chinese, Hindi, and Russian in JSON format.", RAG_ADVANCED]],
88
  cache_examples = False
89
  )
90