schuler commited on
Commit
44881c4
·
verified ·
1 Parent(s): a896bb2

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +22 -1
app.py CHANGED
@@ -108,10 +108,11 @@ def respond(
108
  """
109
  For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
110
  """
111
- status_text = \
112
  f"This chat uses the {REPO_NAME} model with {model.get_memory_footprint() / 1e6:.2f} MB memory footprint." + \
113
  f"You may ask questions such as 'What is biology?' or 'What is the human body?'"
114
 
 
115
  demo = gr.ChatInterface(
116
  respond,
117
  additional_inputs=[
@@ -128,6 +129,26 @@ demo = gr.ChatInterface(
128
  ],
129
  description=status_text
130
  )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
131
 
132
 
133
  if __name__ == "__main__":
 
108
  """
109
  For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
110
  """
111
+ status_text = \
112
  f"This chat uses the {REPO_NAME} model with {model.get_memory_footprint() / 1e6:.2f} MB memory footprint." + \
113
  f"You may ask questions such as 'What is biology?' or 'What is the human body?'"
114
 
115
+ """
116
  demo = gr.ChatInterface(
117
  respond,
118
  additional_inputs=[
 
129
  ],
130
  description=status_text
131
  )
132
+ """
133
+ with gr.Blocks() as demo:
134
+ # Display the status text at the top
135
+ gr.Markdown(status_text)
136
+ # Create the ChatInterface
137
+ chat = gr.ChatInterface(
138
+ respond,
139
+ additional_inputs=[
140
+ gr.Textbox(value="" + global_error, label="System message"),
141
+ gr.Slider(minimum=1, maximum=2048, value=64, step=1, label="Max new tokens"),
142
+ gr.Slider(minimum=0.1, maximum=4.0, value=1.0, step=0.1, label="Temperature"),
143
+ gr.Slider(
144
+ minimum=0.1,
145
+ maximum=1.0,
146
+ value=0.25,
147
+ step=0.05,
148
+ label="Top-p (nucleus sampling)",
149
+ ),
150
+ ],
151
+ )
152
 
153
 
154
  if __name__ == "__main__":