pcuenq HF staff commited on
Commit
c86df15
1 Parent(s): 76a154f

Cache examples (#3)

Browse files

- Cache examples (22922bcf6375a1d0bce71bc5738e989ce12b852c)

Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -138,13 +138,15 @@ with gr.Blocks(css='style.css') as demo:
138
  gr.Examples(
139
  examples = [
140
  ["Hello there! How are you doing?"],
141
- ["Can you explain to me briefly what is Python programming language?"],
142
  ["Explain the plot of Cinderella in a sentence."],
143
  ["How many hours does it take a man to eat a Helicopter?"],
144
  ["Write a 100-word article on 'Benefits of Open-Source in AI research'"]
145
- ],
146
- inputs = textbox,
147
- label = "Click on any example and press the 'Submit' button",
 
 
148
  )
149
  gr.Markdown(LICENSE)
150
 
 
138
  gr.Examples(
139
  examples = [
140
  ["Hello there! How are you doing?"],
141
+ ["Can you explain briefly to me what is the Python programming language?"],
142
  ["Explain the plot of Cinderella in a sentence."],
143
  ["How many hours does it take a man to eat a Helicopter?"],
144
  ["Write a 100-word article on 'Benefits of Open-Source in AI research'"]
145
+ ],
146
+ inputs=textbox,
147
+ outputs=[textbox, chatbot],
148
+ fn=process_example,
149
+ cache_examples=True,
150
  )
151
  gr.Markdown(LICENSE)
152