Omnibus commited on
Commit
462bb26
·
1 Parent(s): c6f9925

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -6
app.py CHANGED
@@ -28,9 +28,12 @@ def predict(text, url_params):
28
  #global site
29
  site=url_params.get('val')
30
  if site == os.environ.get("SECRET"):
31
- print (site)
32
- else: gr.HTML("""<head><meta http-equiv="refresh" content="0;URL='https://omnibus-redirect-access.hf.space'"></head>""")
33
- return ["" + text + "", site]
 
 
 
34
  get_window_url_params = """
35
  function(text_input, url_params) {
36
  console.log(text_input, url_params);
@@ -217,7 +220,7 @@ def clear_fn():
217
  return "",[(None,None)]
218
 
219
  with gr.Blocks() as app:
220
- gr.HTML("""<center><h1>Mixtral 8x7B TLDR Summarizer</h1><h3>Summarize Data of unlimited length</h3>""")
221
  chatbot = gr.Chatbot()
222
  with gr.Row():
223
  with gr.Column(scale=3):
@@ -236,10 +239,10 @@ with gr.Blocks() as app:
236
  text_input=gr.Textbox()
237
  url_params=gr.JSON()
238
  text_output=gr.Textbox()
239
- text_output2=gr.Textbox()
240
  #text=gr.JSON()
241
  #inp_query.change(search_models,inp_query,models_dd)
242
- app.load(fn=predict, inputs=[text_input,url_params],outputs=[text_output,text_output2], js=get_window_url_params)
243
 
244
  clear_btn.click(clear_fn,None,[prompt,chatbot])
245
  go=button.click(summarize,[prompt,chatbot,data,file],[prompt,chatbot],concurrency_limit=1)
 
28
  #global site
29
  site=url_params.get('val')
30
  if site == os.environ.get("SECRET"):
31
+ out=gr.HTML("""<center><h1>Mixtral 8x7B TLDR Summarizer</h1><h3>Summarize Data of unlimited length</h3>""")
32
+
33
+ else:
34
+ out=gr.HTML("""<head><meta http-equiv="refresh" content="0;URL='https://omnibus-redirect-access.hf.space'"></head>""")
35
+
36
+ return ["" + text + "", out]
37
  get_window_url_params = """
38
  function(text_input, url_params) {
39
  console.log(text_input, url_params);
 
220
  return "",[(None,None)]
221
 
222
  with gr.Blocks() as app:
223
+ out=gr.HTML("""""")
224
  chatbot = gr.Chatbot()
225
  with gr.Row():
226
  with gr.Column(scale=3):
 
239
  text_input=gr.Textbox()
240
  url_params=gr.JSON()
241
  text_output=gr.Textbox()
242
+ #out_html=gr.HTML()
243
  #text=gr.JSON()
244
  #inp_query.change(search_models,inp_query,models_dd)
245
+ app.load(fn=predict, inputs=[text_input,url_params],outputs=[text_output,out], js=get_window_url_params)
246
 
247
  clear_btn.click(clear_fn,None,[prompt,chatbot])
248
  go=button.click(summarize,[prompt,chatbot,data,file],[prompt,chatbot],concurrency_limit=1)