Tonic commited on
Commit
50eae3e
1 Parent(s): 2d5895c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -10
app.py CHANGED
@@ -39,23 +39,22 @@ def pred(text_in, d_model, n_layer, vocab_size, genlen, temperature, top_k, top_
39
 
40
  text_out = tokenizer.batch_decode(output.sequences.tolist(), skip_special_tokens=True)
41
  return text_out[0]
42
-
43
- # Define Gradio interface
44
  demo = gr.Interface(
45
  fn=pred,
46
  inputs=[
47
  gr.Textbox(label="Input Text"),
48
- gr.Slider(minimum=128, maximum=1024, default=512, label="Model Dimension (d_model)"),
49
- gr.Slider(minimum=1, maximum=24, default=12, label="Number of Layers (n_layer)"),
50
- gr.Number(default=50257, label="Vocabulary Size (vocab_size)"),
51
- gr.Slider(minimum=50, maximum=500, default=200, label="Generation Length (genlen)"),
52
- gr.Slider(minimum=0.1, maximum=1.0, default=0.5, label="Temperature"),
53
- gr.Slider(minimum=1, maximum=50, default=10, label="Top K"),
54
- gr.Slider(minimum=0.1, maximum=1.0, default=0.9, label="Top P"),
55
  ],
56
  outputs="text",
57
  title="Welcome to Tonic's 🐍Mamba",
58
- description="With this Demo, you can customize the model hyperparameters of [🐍Mamba](https://www.huggingface.co/state-spaces/mamba-2.8b) . Everytime you send a request it will instantiate the model accordingly, so please be patient."
59
  )
60
 
61
  if __name__ == "__main__":
 
39
 
40
  text_out = tokenizer.batch_decode(output.sequences.tolist(), skip_special_tokens=True)
41
  return text_out[0]
42
+ pass
 
43
  demo = gr.Interface(
44
  fn=pred,
45
  inputs=[
46
  gr.Textbox(label="Input Text"),
47
+ gr.Slider(minimum=128, maximum=1024, value=512, label="Model Dimension (d_model)"),
48
+ gr.Slider(minimum=1, maximum=24, value=12, label="Number of Layers (n_layer)"),
49
+ gr.Number(value=50257, label="Vocabulary Size (vocab_size)"),
50
+ gr.Slider(minimum=50, maximum=500, value=200, label="Generation Length (genlen)"),
51
+ gr.Slider(minimum=0.1, maximum=1.0, value=0.5, label="Temperature"),
52
+ gr.Slider(minimum=1, maximum=50, value=10, label="Top K"),
53
+ gr.Slider(minimum=0.1, maximum=1.0, value=0.9, label="Top P"),
54
  ],
55
  outputs="text",
56
  title="Welcome to Tonic's 🐍Mamba",
57
+ description="With this Demo, you can customize the model hyperparameters of [🐍Mamba](https://www.huggingface.co/state-spaces/mamba-2.8b). Every time you send a request it will instantiate the model accordingly, so please be patient."
58
  )
59
 
60
  if __name__ == "__main__":