a100 kh commited on
Commit
0798f48
1 Parent(s): 9c53a13
Files changed (1) hide show
  1. app.py +62 -2
app.py CHANGED
@@ -97,6 +97,66 @@ with gr.Blocks(css=CSS) as interface:
97
  demo.render()
98
  # components = [gr.Markdown(description), demo]
99
 
100
- if __name__ == "__main__":
101
  # demo.launch()
102
- interface.launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
97
  demo.render()
98
  # components = [gr.Markdown(description), demo]
99
 
100
+ # if __name__ == "__main__":
101
  # demo.launch()
102
+ # interface.launch()
103
+
104
+
105
+ HEADER = description
106
+ FOOTER = ""
107
+
108
+
109
+ def run():
110
+ chatbot = gr.Chatbot(
111
+ elem_id="chatbot",
112
+ scale=1,
113
+ show_copy_button=True,
114
+ height="70%",
115
+ layout="panel",
116
+ )
117
+ with gr.Blocks(fill_height=True) as demo:
118
+ gr.Markdown(HEADER)
119
+ gr.ChatInterface(
120
+ fn=respond,
121
+ stop_btn="Stop Generation",
122
+ cache_examples=False,
123
+ multimodal=False,
124
+ chatbot=chatbot,
125
+ additional_inputs_accordion=gr.Accordion(
126
+ label="Parameters", open=False, render=False
127
+ ),
128
+ additional_inputs=[
129
+
130
+ gr.Slider(
131
+ minimum=1,
132
+ maximum=4096,
133
+ step=1,
134
+ value=1024,
135
+ label="Max tokens",
136
+ visible=True,
137
+ render=False,
138
+ ),
139
+ gr.Slider(
140
+ minimum=0,
141
+ maximum=1,
142
+ step=0.1,
143
+ value=0.3,
144
+ label="Temperature",
145
+ visible=True,
146
+ render=False,
147
+ ),
148
+ gr.Slider(
149
+ minimum=0,
150
+ maximum=1,
151
+ step=0.1,
152
+ value=1.0,
153
+ label="Top-p",
154
+ visible=True,
155
+ render=False,
156
+ ),
157
+ ],
158
+ analytics_enabled=False,
159
+ )
160
+ gr.Markdown(FOOTER)
161
+ demo.queue(max_size=256, api_open=False)
162
+ demo.launch(share=False, quiet=True)