Anitaliu98 commited on
Commit
cab0013
·
verified ·
1 Parent(s): f11423c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -9
app.py CHANGED
@@ -46,16 +46,25 @@ def http_bot(messages, argsbox):
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
 
 
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
+ 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