cryptocalypse commited on
Commit
1e2c6dd
1 Parent(s): 73bca48

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +42 -16
app.py CHANGED
@@ -107,22 +107,48 @@ def respond(
107
  """
108
  For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
109
  """
110
- demo = gr.ChatInterface(
111
- respond,
112
- additional_inputs=[
113
- gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
114
- gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
115
- gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
116
- gr.Slider(
117
- minimum=0.1,
118
- maximum=1.0,
119
- value=0.95,
120
- step=0.05,
121
- label="Top-p (nucleus sampling)",
122
- ),
123
- ],
124
- )
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
125
 
126
 
127
  if __name__ == "__main__":
128
- demo.launch()
 
107
  """
108
  For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
109
  """
110
+
111
+ with gr.Blocks(title="Holmes pubication manager") as app:
112
+ gr.Dropdown(
113
+ ["Spain Journals", "Usa journals", "England journals","Technology","Religion"], value=["Spain Journals", "Usa journals", "England journals","Technology","Religion"], multiselect=True, label="Source Databases", info="Selecting Tag sources Holmesbot AI uses that to generate news, with priority of Google Trends and X trending topics"
114
+ )
115
+ chatBot = gr.ChatInterface(
116
+ respond,
117
+ retry_btn=None,
118
+ undo_btn="Undo",
119
+ clear_btn="Clear"
120
+
121
+ )
122
+
123
+ with gr.Tab("Search"):
124
+ with gr.Row():
125
+ txt_search = gr.Textbox(value="Donald Trump",scale=5)
126
+ btn_search = gr.Button("Search",scale=1)
127
+ with gr.Row():
128
+ big_block = gr.HTML("""
129
+ <iframe style="scroll-padding-left: 50%; relative;background-color: #fff; height: 75vh; width: 100%; overflow-y: hidden; overflow-x: hidden;" src="https://holmesbot.com/api/shared?id=16657e456d9514"></iframe>
130
+ """)
131
+
132
+ with gr.Tab("Image"):
133
+ gr.load("models/stabilityai/stable-diffusion-xl-base-1.0")
134
+ with gr.Tab("Chat"):
135
+
136
+ demo = gr.ChatInterface(
137
+ respond,
138
+ additional_inputs=[
139
+ gr.Textbox(value="You are a friendly Chatbot.", label="System message"),
140
+ gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
141
+ gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
142
+ gr.Slider(
143
+ minimum=0.1,
144
+ maximum=1.0,
145
+ value=0.95,
146
+ step=0.05,
147
+ label="Top-p (nucleus sampling)",
148
+ ),
149
+ ],
150
+ )
151
 
152
 
153
  if __name__ == "__main__":
154
+ app.launch()