girishwangikar commited on
Commit
a66c6e1
·
verified ·
1 Parent(s): fe0a93c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -28
app.py CHANGED
@@ -49,39 +49,33 @@ def clear_conversation():
49
 
50
  chatbot = gr.Chatbot(height=600, placeholder=PLACEHOLDER)
51
 
52
- with gr.Blocks(css=CSS, theme="GSW") as demo:
53
  gr.HTML(TITLE)
54
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  chat_interface = gr.ChatInterface(
56
  fn=generate_response,
57
  chatbot=chatbot,
58
- fill_height=True,
59
- additional_inputs=[
60
- gr.Accordion(
61
- label="⚙️ Parameters",
62
- open=False,
63
- children=[
64
- gr.Textbox(
65
- value="You are a helpful coding assistant, specialized in code completion, debugging, and analysis. Provide concise and accurate responses.",
66
- label="System Prompt",
67
- ),
68
- gr.Slider(
69
- minimum=0,
70
- maximum=1,
71
- step=0.1,
72
- value=0.5,
73
- label="Temperature",
74
- ),
75
- gr.Slider(
76
- minimum=50,
77
- maximum=1024,
78
- step=1,
79
- value=512,
80
- label="Max tokens",
81
- ),
82
- ]
83
- )
84
- ],
85
  examples=[
86
  ["What are Python generators, and how do I use them effectively in my code?"],
87
  ["Can you explain the different types of SQL joins with examples?"],
 
49
 
50
  chatbot = gr.Chatbot(height=600, placeholder=PLACEHOLDER)
51
 
52
+ with gr.Blocks(css=CSS) as demo:
53
  gr.HTML(TITLE)
54
 
55
+ with gr.Accordion("⚙️ Parameters", open=False):
56
+ system_prompt = gr.Textbox(
57
+ value="You are a helpful coding assistant, specialized in code completion, debugging, and analysis. Provide concise and accurate responses.",
58
+ label="System Prompt",
59
+ )
60
+ temperature = gr.Slider(
61
+ minimum=0,
62
+ maximum=1,
63
+ step=0.1,
64
+ value=0.5,
65
+ label="Temperature",
66
+ )
67
+ max_tokens = gr.Slider(
68
+ minimum=50,
69
+ maximum=1024,
70
+ step=1,
71
+ value=512,
72
+ label="Max tokens",
73
+ )
74
+
75
  chat_interface = gr.ChatInterface(
76
  fn=generate_response,
77
  chatbot=chatbot,
78
+ additional_inputs=[system_prompt, temperature, max_tokens],
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
79
  examples=[
80
  ["What are Python generators, and how do I use them effectively in my code?"],
81
  ["Can you explain the different types of SQL joins with examples?"],