Update app.py
Browse files
app.py
CHANGED
@@ -17,7 +17,7 @@ _ = load_dotenv(find_dotenv())
|
|
17 |
#openai.api_key = os.environ["OPENAI_API_KEY"]
|
18 |
|
19 |
template = """Use the following pieces of context to answer the question at the end. If you don't know the answer, just say that you don't know, don't try to make up
|
20 |
-
an answer. Keep the answer as concise as possible. Always say "
|
21 |
{context} Question: {question} Helpful Answer: """
|
22 |
|
23 |
QA_CHAIN_PROMPT = PromptTemplate(input_variables = ["context", "question"], template = template)
|
@@ -47,7 +47,7 @@ description = """The app demonstrates how to use a <strong>Large Language Model<
|
|
47 |
|
48 |
gr.close_all()
|
49 |
demo = gr.Interface(fn=invoke,
|
50 |
-
inputs = [gr.Textbox(label = "OpenAI API Key", value = "sk-", lines = 1), gr.Textbox(label = "YouTube URL", value = "https://www.youtube.com/watch?v=
|
51 |
outputs = [gr.Textbox(label = "Completion", lines = 1)],
|
52 |
title = "Generative AI - LLM & RAG",
|
53 |
description = description)
|
|
|
17 |
#openai.api_key = os.environ["OPENAI_API_KEY"]
|
18 |
|
19 |
template = """Use the following pieces of context to answer the question at the end. If you don't know the answer, just say that you don't know, don't try to make up
|
20 |
+
an answer. Keep the answer as concise as possible. Always say "🔥 Thanks for using the app, Bernd Straehle." at the end of the answer.
|
21 |
{context} Question: {question} Helpful Answer: """
|
22 |
|
23 |
QA_CHAIN_PROMPT = PromptTemplate(input_variables = ["context", "question"], template = template)
|
|
|
47 |
|
48 |
gr.close_all()
|
49 |
demo = gr.Interface(fn=invoke,
|
50 |
+
inputs = [gr.Textbox(label = "OpenAI API Key", value = "sk-", lines = 1), gr.Textbox(label = "YouTube URL", value = "https://www.youtube.com/watch?v=b1_RKu-ESCY", lines = 1), gr.Textbox(label = "Prompt", value = "Analyze the sentiment in one sentence, then translate sentiment into German and French", lines = 1)],
|
51 |
outputs = [gr.Textbox(label = "Completion", lines = 1)],
|
52 |
title = "Generative AI - LLM & RAG",
|
53 |
description = description)
|