Omnibus commited on
Commit
5ef0a00
·
verified ·
1 Parent(s): 6aefd1f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -8
app.py CHANGED
@@ -395,6 +395,14 @@ def format_json(inp):
395
 
396
  return out_json
397
 
 
 
 
 
 
 
 
 
398
  def mm(graph):
399
  code_out=""
400
  for ea in graph.split("\n"):
@@ -402,7 +410,7 @@ def mm(graph):
402
  code_out+=code
403
  #out_html=f'''<div><iframe src="https://omnibus-mermaid-script.static.hf.space/index.html?mermaid={code_out}&rand={random.randint(1,1111111111)}" height="500" width="500"></iframe></div>'''
404
  out_html=f'''<div id="wrap"><iframe id="frame" src="https://omnibus-mermaid-script.static.hf.space/index.html?mermaid={code_out}" height="500" width="500"></iframe></div>'''
405
- return out_html
406
 
407
  def summarize(inp,history,data=None,files=None,directory=None,url=None,pdf_url=None,pdf_batch=None):
408
  json_box=[]
@@ -509,18 +517,14 @@ def clear_fn():
509
  return "",[(None,None)]
510
 
511
 
512
- css="""
513
- #wrap { width: 100%; height: 100%; padding: 0; overflow: auto; }
514
- #frame { width: 100%; border: 1px solid black; }
515
- #frame { zoom: $ZOOM; -moz-transform: scale($ZOOM); -moz-transform-origin: 0 0; }
516
- """
517
  this=["1.25"]
518
  def zoom_update(inp):
519
  this.clear()
520
- this.update(inp)
521
 
522
 
523
- with gr.Blocks(css=css.replace("$ZOOM",this[0])) as app:
524
  gr.HTML("""<center><h1>Mixtral 8x7B TLDR Summarizer + Web</h1><h3>Summarize Data of unlimited length</h3>""")
525
  chatbot = gr.Chatbot(label="Mixtral 8x7B Chatbot",show_copy_button=True)
526
  with gr.Row():
 
395
 
396
  return out_json
397
 
398
+
399
+ css="""
400
+ #wrap { width: 100%; height: 100%; padding: 0; overflow: auto; }
401
+ #frame { width: 100%; border: 1px solid black; }
402
+ #frame { zoom: $ZOOM; -moz-transform: scale($ZOOM); -moz-transform-origin: 0 0; }
403
+ """
404
+
405
+
406
  def mm(graph):
407
  code_out=""
408
  for ea in graph.split("\n"):
 
410
  code_out+=code
411
  #out_html=f'''<div><iframe src="https://omnibus-mermaid-script.static.hf.space/index.html?mermaid={code_out}&rand={random.randint(1,1111111111)}" height="500" width="500"></iframe></div>'''
412
  out_html=f'''<div id="wrap"><iframe id="frame" src="https://omnibus-mermaid-script.static.hf.space/index.html?mermaid={code_out}" height="500" width="500"></iframe></div>'''
413
+ return gr.update(out_html,css=css.replace("$ZOOM",this[0]))
414
 
415
  def summarize(inp,history,data=None,files=None,directory=None,url=None,pdf_url=None,pdf_batch=None):
416
  json_box=[]
 
517
  return "",[(None,None)]
518
 
519
 
520
+
 
 
 
 
521
  this=["1.25"]
522
  def zoom_update(inp):
523
  this.clear()
524
+ this.update(str(inp))
525
 
526
 
527
+ with gr.Blocks() as app:
528
  gr.HTML("""<center><h1>Mixtral 8x7B TLDR Summarizer + Web</h1><h3>Summarize Data of unlimited length</h3>""")
529
  chatbot = gr.Chatbot(label="Mixtral 8x7B Chatbot",show_copy_button=True)
530
  with gr.Row():