jchen8000 commited on
Commit
f16ca94
·
verified ·
1 Parent(s): d62b63a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -6
app.py CHANGED
@@ -18,6 +18,14 @@ vector_store = None
18
  # Sample PDF file
19
  sample_filename = "Attention Is All You Need.pdf"
20
 
 
 
 
 
 
 
 
 
21
  template = \
22
  """Use the following pieces of context to answer the question at the end.
23
  If you don't know the answer, just say that you don't know, don't try to make up an answer.
@@ -106,11 +114,6 @@ additional_inputs = [
106
  gr.Number(precision=0, value=0, label="Seed", info="A starting point to initiate generation, use 0 for random")
107
  ]
108
 
109
-
110
- examples = [["What is Transformer"],
111
- ["What is Attention"],
112
- ]
113
-
114
  # Create the Gradio interface
115
  with gr.Blocks(theme="Nymbo/Alyx_Theme") as demo:
116
  with gr.Tab("Indexing"):
@@ -125,7 +128,7 @@ with gr.Blocks(theme="Nymbo/Alyx_Theme") as demo:
125
  gr.ChatInterface(
126
  fn=generate_response,
127
  chatbot=gr.Chatbot(show_label=False, show_share_button=False, show_copy_button=True, likeable=True, layout="panel"),
128
- examples=examples,
129
  additional_inputs=additional_inputs,
130
  )
131
 
 
18
  # Sample PDF file
19
  sample_filename = "Attention Is All You Need.pdf"
20
 
21
+ examples_questions = [["What is Transformer?"],
22
+ ["What is Attention?"],
23
+ ["What is Scaled Dot-Product Attention?"],
24
+ ["What are Encoder and Decoder?"],
25
+ ["Describe more about the Transformer."],
26
+ ["Why use self-attention?"],
27
+ ]
28
+
29
  template = \
30
  """Use the following pieces of context to answer the question at the end.
31
  If you don't know the answer, just say that you don't know, don't try to make up an answer.
 
114
  gr.Number(precision=0, value=0, label="Seed", info="A starting point to initiate generation, use 0 for random")
115
  ]
116
 
 
 
 
 
 
117
  # Create the Gradio interface
118
  with gr.Blocks(theme="Nymbo/Alyx_Theme") as demo:
119
  with gr.Tab("Indexing"):
 
128
  gr.ChatInterface(
129
  fn=generate_response,
130
  chatbot=gr.Chatbot(show_label=False, show_share_button=False, show_copy_button=True, likeable=True, layout="panel"),
131
+ examples=examples_questions,
132
  additional_inputs=additional_inputs,
133
  )
134