Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -18,7 +18,7 @@ model.to(device)
|
|
18 |
MAX_INPUT_TOKEN_LENGTH = 4096 # You may need to adjust this value
|
19 |
|
20 |
@spaces.GPU
|
21 |
-
def
|
22 |
message: str,
|
23 |
chat_history: list[tuple[str, str]],
|
24 |
system_prompt: str,
|
@@ -62,17 +62,23 @@ def generate(
|
|
62 |
yield "".join(outputs)
|
63 |
|
64 |
demo = gr.ChatInterface(
|
65 |
-
|
66 |
additional_inputs=[
|
67 |
-
gr.Textbox(value="You are Magpie, a
|
68 |
-
gr.Slider(minimum=1, maximum=2048, value=
|
69 |
gr.Slider(minimum=0.1, maximum=4.0, value=0.6, step=0.1, label="Temperature"),
|
70 |
-
gr.Slider(
|
71 |
-
|
72 |
-
|
|
|
|
|
|
|
|
|
|
|
73 |
],
|
74 |
)
|
75 |
|
|
|
76 |
if __name__ == "__main__":
|
77 |
demo.queue()
|
78 |
demo.launch(share=True)
|
|
|
18 |
MAX_INPUT_TOKEN_LENGTH = 4096 # You may need to adjust this value
|
19 |
|
20 |
@spaces.GPU
|
21 |
+
def respond(
|
22 |
message: str,
|
23 |
chat_history: list[tuple[str, str]],
|
24 |
system_prompt: str,
|
|
|
62 |
yield "".join(outputs)
|
63 |
|
64 |
demo = gr.ChatInterface(
|
65 |
+
respond,
|
66 |
additional_inputs=[
|
67 |
+
gr.Textbox(value="You are Magpie, a helpful AI assistant.", label="System message"),
|
68 |
+
gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|
69 |
gr.Slider(minimum=0.1, maximum=4.0, value=0.6, step=0.1, label="Temperature"),
|
70 |
+
gr.Slider(
|
71 |
+
minimum=0.1,
|
72 |
+
maximum=1.0,
|
73 |
+
value=0.9,
|
74 |
+
step=0.05,
|
75 |
+
label="Top-p (nucleus sampling)",
|
76 |
+
),
|
77 |
+
gr.Slider(minimum=0.5, maximum=1.5, value=1.0, step=0.1, label="Repetation Penalty"),
|
78 |
],
|
79 |
)
|
80 |
|
81 |
+
|
82 |
if __name__ == "__main__":
|
83 |
demo.queue()
|
84 |
demo.launch(share=True)
|