SrijitMukherjee commited on
Commit
48681da
·
verified ·
1 Parent(s): 363b4ca

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -7
app.py CHANGED
@@ -7,12 +7,10 @@ def get_output(prompt):
7
  response = client.text_generation(prompt, max_new_tokens=512, temperature=0.7, top_p=0.95)
8
  return response[0]['generated_text']
9
 
10
- demo = gr.Interface(
11
- fn=get_output,
12
- inputs=["text", "button"],
13
- outputs="text",
14
- title="LLaMA Gradio App",
15
- description="Click the button to get the output"
16
- )
17
 
18
  demo.launch()
 
7
  response = client.text_generation(prompt, max_new_tokens=512, temperature=0.7, top_p=0.95)
8
  return response[0]['generated_text']
9
 
10
+ with gr.Blocks() as demo:
11
+ prompt = gr.Textbox(label="Enter your prompt")
12
+ button = gr.Button("Generate Output")
13
+ output = gr.Textbox(label="Output")
14
+ button.click(get_output, inputs=prompt, outputs=output)
 
 
15
 
16
  demo.launch()