Browse Source

feat: add do sample

shellmiao 1 year ago
parent
commit
4d6343e4f6
1 changed files with 5 additions and 4 deletions
  1. 5 4
      GlobalModel_generated.py

+ 5 - 4
GlobalModel_generated.py

@@ -131,6 +131,7 @@ def main(
             top_p=top_p,
             top_k=top_k,
             num_beams=num_beams,
+            do_sample=True,
             **kwargs,
         )
 
@@ -196,16 +197,16 @@ def main(
             ),
             gr.components.Textbox(lines=2, label="Input", placeholder="none"),
             gr.components.Slider(
-                minimum=0, maximum=1, value=0.1, label="Temperature"
+                minimum=0, maximum=1, value=0.01, label="Temperature"
             ),
             gr.components.Slider(
-                minimum=0, maximum=1, value=0.75, label="Top p"
+                minimum=0, maximum=1, value=0.03, label="Top p"
             ),
             gr.components.Slider(
-                minimum=0, maximum=100, step=1, value=40, label="Top k"
+                minimum=0, maximum=100, step=1, value=1, label="Top k"
             ),
             gr.components.Slider(
-                minimum=1, maximum=4, step=1, value=4, label="Beams"
+                minimum=1, maximum=4, step=1, value=1, label="Beams"
             ),
             gr.components.Slider(
                 minimum=1, maximum=2000, step=1, value=128, label="Max tokens"