Spestly commited on
Commit
1c4e5c1
Β·
verified Β·
1 Parent(s): 9c405c2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +28 -20
app.py CHANGED
@@ -95,26 +95,13 @@ theme = gr.themes.Monochrome()
95
  with gr.Blocks(title="Athena Playground Chat", css=css, theme=theme) as demo:
96
  gr.Markdown("# πŸš€ Athena Playground Chat")
97
  gr.Markdown("*Powered by HuggingFace ZeroGPU*")
98
- with gr.Row():
99
- with gr.Column(scale=1):
100
- model_choice = gr.Dropdown(
101
- label="πŸ“± Model",
102
- choices=list(MODELS.keys()),
103
- value="Athena-R3X 8B",
104
- info="Select which Athena model to use"
105
- )
106
- with gr.Column(scale=1):
107
- max_length = gr.Slider(
108
- 32, 2048, value=512,
109
- label="πŸ“ Max Tokens",
110
- info="Maximum number of tokens to generate"
111
- )
112
- with gr.Column(scale=1):
113
- temperature = gr.Slider(
114
- 0.1, 2.0, value=0.7,
115
- label="🎨 Creativity",
116
- info="Higher values = more creative responses"
117
- )
118
  chat_interface = gr.ChatInterface(
119
  fn=respond,
120
  additional_inputs=[model_choice, max_length, temperature],
@@ -137,5 +124,26 @@ with gr.Blocks(title="Athena Playground Chat", css=css, theme=theme) as demo:
137
  type="messages"
138
  )
139
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
140
  if __name__ == "__main__":
141
  demo.launch()
 
95
  with gr.Blocks(title="Athena Playground Chat", css=css, theme=theme) as demo:
96
  gr.Markdown("# πŸš€ Athena Playground Chat")
97
  gr.Markdown("*Powered by HuggingFace ZeroGPU*")
98
+
99
+ # Placeholders for config components
100
+ model_choice = gr.State("Athena-R3X 8B")
101
+ max_length = gr.State(512)
102
+ temperature = gr.State(0.7)
103
+
104
+ # Main chat interface
 
 
 
 
 
 
 
 
 
 
 
 
 
105
  chat_interface = gr.ChatInterface(
106
  fn=respond,
107
  additional_inputs=[model_choice, max_length, temperature],
 
124
  type="messages"
125
  )
126
 
127
+ # Accordion at the bottom for configurations
128
+ with gr.Accordion("Configurations", open=False):
129
+ model_choice = gr.Dropdown(
130
+ label="πŸ“± Model",
131
+ choices=list(MODELS.keys()),
132
+ value="Athena-R3X 8B",
133
+ info="Select which Athena model to use"
134
+ )
135
+ max_length = gr.Slider(
136
+ 32, 2048, value=512,
137
+ label="πŸ“ Max Tokens",
138
+ info="Maximum number of tokens to generate"
139
+ )
140
+ temperature = gr.Slider(
141
+ 0.1, 2.0, value=0.7,
142
+ label="🎨 Creativity",
143
+ info="Higher values = more creative responses"
144
+ )
145
+ # Link the config components to the chat interface's additional_inputs
146
+ chat_interface.additional_inputs = [model_choice, max_length, temperature]
147
+
148
  if __name__ == "__main__":
149
  demo.launch()