bstraehle commited on
Commit
c4e6b0f
·
1 Parent(s): fa3f6cb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
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,
20
- don't try to make up an answer. Keep the answer as concise as possible. Always say "Thanks, 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)
@@ -46,7 +46,7 @@ description = """The app demonstrates how to use a <strong>Large Language Model<
46
 
47
  gr.close_all()
48
  demo = gr.Interface(fn=invoke,
49
- inputs = [gr.Textbox(label = "OpenAI API Key", lines = 1), gr.Textbox(label = "YouTube URL", lines = 1), gr.Textbox(label = "Prompt", lines = 1)],
50
  outputs = [gr.Textbox(label = "Completion", lines = 1)],
51
  title = "Generative AI - LLM & RAG",
52
  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,
20
+ don't try to make up an answer. Keep the answer as concise as possible. Always say "\n\nThanks, 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)
 
46
 
47
  gr.close_all()
48
  demo = gr.Interface(fn=invoke,
49
+ inputs = [gr.Textbox(label = "OpenAI API Key", default = "sk-", lines = 1), gr.Textbox(label = "YouTube URL", default = "https://www.youtube.com/watch?v=3cQNkIrg-Tk", lines = 1), gr.Textbox(label = "Prompt", default = "What is the sentiment of the song?", lines = 1)],
50
  outputs = [gr.Textbox(label = "Completion", lines = 1)],
51
  title = "Generative AI - LLM & RAG",
52
  description = description)