Spaces:
Running
Running
Update app.py
Browse files
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 |
-
|
14 |
-
|
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,
|
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?",
|
84 |
-
["sk-<BringYourOwn>", "List GPT-4's exam scores and benchmark results.",
|
85 |
-
["sk-<BringYourOwn>", "Compare GPT-4 to GPT-3.5 in markdown table format.",
|
86 |
-
["sk-<BringYourOwn>", "Write a Python program that calls the GPT-4 API.",
|
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.",
|
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 |
|