Luke Stanley commited on
Commit
acc8b42
·
1 Parent(s): 2dac454

Add cached examples

Browse files
Files changed (1) hide show
  1. app.py +13 -1
app.py CHANGED
@@ -40,5 +40,17 @@ def chill_out(text):
40
  print("Got this input:", text)
41
  return str(improvement_loop(text))
42
 
43
- demo = gr.Interface(fn=chill_out, inputs="text", outputs="text")
 
 
 
 
 
 
 
 
 
 
 
 
44
  demo.launch(max_threads=1, share=True)
 
40
  print("Got this input:", text)
41
  return str(improvement_loop(text))
42
 
43
+ examples = [
44
+ ["You guys are so slow, we will never ship it!"],
45
+ ["Your idea of a balanced diet is a biscuit in each hand."]
46
+ ]
47
+
48
+ demo = gr.Interface(
49
+ fn=chill_out,
50
+ inputs="text",
51
+ outputs="text",
52
+ examples=examples,
53
+ cache_examples=True # Enable caching
54
+ )
55
+
56
  demo.launch(max_threads=1, share=True)