rgreenberg1 commited on
Commit
1d4a7a3
·
verified ·
1 Parent(s): 55b009f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +46 -1
app.py CHANGED
@@ -58,7 +58,52 @@ with gr.Blocks() as demo:
58
  "James decides to run 3 sprints 3 times a week. He runs 60 meters each sprint. How many total meters does he run a week?",
59
  "Claire makes a 3 egg omelet every morning for breakfast. How many dozens of eggs will she eat in 4 weeks?",
60
  "Gretchen has 110 coins. There are 30 more gold coins than silver coins. How many gold coins does Gretchen have?",],inputs=[textbox],)
61
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
 
63
  # Generation inference
64
  def generate(
 
58
  "James decides to run 3 sprints 3 times a week. He runs 60 meters each sprint. How many total meters does he run a week?",
59
  "Claire makes a 3 egg omelet every morning for breakfast. How many dozens of eggs will she eat in 4 weeks?",
60
  "Gretchen has 110 coins. There are 30 more gold coins than silver coins. How many gold coins does Gretchen have?",],inputs=[textbox],)
61
+
62
+ max_new_tokens = gr.Slider(
63
+ label="Max new tokens",
64
+ value=DEFAULT_MAX_NEW_TOKENS,
65
+ minimum=0,
66
+ maximum=MAX_MAX_NEW_TOKENS,
67
+ step=1,
68
+ interactive=True,
69
+ info="The maximum numbers of new tokens",)
70
+ temperature = gr.Slider(
71
+ label="Temperature",
72
+ value=0.3,
73
+ minimum=0.05,
74
+ maximum=1.0,
75
+ step=0.05,
76
+ interactive=True,
77
+ info="Higher values produce more diverse outputs",
78
+ )
79
+ top_p = gr.Slider(
80
+ label="Top-p (nucleus) sampling",
81
+ value=0.40,
82
+ minimum=0.0,
83
+ maximum=1,
84
+ step=0.05,
85
+ interactive=True,
86
+ info="Higher values sample more low-probability tokens",
87
+ )
88
+ top_k = gr.Slider(
89
+ label="Top-k sampling",
90
+ value=20,
91
+ minimum=1,
92
+ maximum=100,
93
+ step=1,
94
+ interactive=True,
95
+ info="Sample from the top_k most likely tokens",
96
+ )
97
+ repetition_penalty = gr.Slider(
98
+ label="Repetition penalty",
99
+ value=1.2,
100
+ minimum=1.0,
101
+ maximum=2.0,
102
+ step=0.05,
103
+ interactive=True,
104
+ info="Penalize repeated tokens",
105
+ )
106
+
107
 
108
  # Generation inference
109
  def generate(