Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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,
|
49 |
-
gr.Slider(minimum=1, maximum=24,
|
50 |
-
gr.Number(
|
51 |
-
gr.Slider(minimum=50, maximum=500,
|
52 |
-
gr.Slider(minimum=0.1, maximum=1.0,
|
53 |
-
gr.Slider(minimum=1, maximum=50,
|
54 |
-
gr.Slider(minimum=0.1, maximum=1.0,
|
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)
|
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__":
|