prithivMLmods commited on
Commit
1e2ed35
1 Parent(s): 73d3ba2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -2
app.py CHANGED
@@ -102,19 +102,27 @@ def generate(
102
 
103
  def gradio_interface():
104
  with gr.Blocks(css=css, theme="bethecloud/storj_theme") as demo:
 
105
  with gr.Row():
106
  mood = gr.Radio(choices=list(mood_prompts.keys()), value="Professional", label="Select Mood")
107
- history = gr.State([])
 
 
108
  system_prompt = gr.Textbox(placeholder="System prompt (optional)", lines=1)
109
  prompt = gr.Textbox(placeholder="Enter your message", lines=2)
 
 
 
110
  generate_btn = gr.Button("Generate")
111
  output = gr.Chatbot()
112
-
 
113
  generate_btn.click(
114
  generate,
115
  inputs=[prompt, history, system_prompt, mood],
116
  outputs=[output]
117
  )
 
118
  demo.queue().launch(show_api=False)
119
 
120
  gradio_interface()
 
102
 
103
  def gradio_interface():
104
  with gr.Blocks(css=css, theme="bethecloud/storj_theme") as demo:
105
+ # Row for mood selection
106
  with gr.Row():
107
  mood = gr.Radio(choices=list(mood_prompts.keys()), value="Professional", label="Select Mood")
108
+
109
+ # Row for system prompt and user prompt
110
+ with gr.Row():
111
  system_prompt = gr.Textbox(placeholder="System prompt (optional)", lines=1)
112
  prompt = gr.Textbox(placeholder="Enter your message", lines=2)
113
+
114
+ # Row for generate button and output
115
+ with gr.Row():
116
  generate_btn = gr.Button("Generate")
117
  output = gr.Chatbot()
118
+
119
+ # Connect button click to generate function
120
  generate_btn.click(
121
  generate,
122
  inputs=[prompt, history, system_prompt, mood],
123
  outputs=[output]
124
  )
125
+
126
  demo.queue().launch(show_api=False)
127
 
128
  gradio_interface()