Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -46,25 +46,17 @@ def http_bot(messages, argsbox):
|
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
|
| 58 |
-
|
| 59 |
|
| 60 |
-
# demo.launch(share=True)
|
| 61 |
-
|
| 62 |
-
demo = gr.Interface(
|
| 63 |
-
fn=predict,
|
| 64 |
-
inputs=[gr.Textbox(label="Input",placeholder="Enter text and press ENTER")\
|
| 65 |
-
gr.Textbox(label="Args", placeholder="a dict of {api_key, base_url, model, temperature, max_tokens}")
|
| 66 |
-
],
|
| 67 |
-
outputs='text',
|
| 68 |
-
)
|
| 69 |
demo.launch(share=True)
|
| 70 |
|
|
|
|
|
|
| 46 |
|
| 47 |
|
| 48 |
|
| 49 |
+
with gr.Blocks() as demo:
|
| 50 |
+
gr.Markdown("# vLLM text completion demo\n")
|
| 51 |
+
inputbox = gr.Textbox(label="Input",
|
| 52 |
+
placeholder="Enter text and press ENTER")
|
| 53 |
+
argsbox = gr.Textbox(label="Args", placeholder="a dict of {api_key, base_url, model, temperature, max_tokens}")
|
| 54 |
+
outputbox = gr.Textbox(label="Output",
|
| 55 |
+
placeholder="Generated result from the model")
|
| 56 |
+
submit = gr.Button("Submit")
|
| 57 |
|
| 58 |
+
submit.click(http_bot, [inputbox, argsbox], [outputbox], api_name="submit")
|
| 59 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
demo.launch(share=True)
|
| 61 |
|
| 62 |
+
|