Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,21 +1,8 @@
|
|
1 |
import gradio as gr
|
2 |
-
import IPython
|
3 |
-
import nbformat
|
4 |
-
from nbconvert import HTMLExporter
|
5 |
-
from IPython.display import HTML
|
6 |
-
import requests
|
7 |
from model_list import ModelList
|
8 |
from data_list import DataList
|
9 |
|
10 |
|
11 |
-
|
12 |
-
def show_notebook(notebook_file):
|
13 |
-
with open(notebook_file, 'r', encoding='utf-8') as notebook_file:
|
14 |
-
notebook_content = nbformat.read(notebook_file, as_version=4)
|
15 |
-
html_expor = HTMLExporter()
|
16 |
-
html_output, resources = html_expor.from_notebook_node(notebook_content)
|
17 |
-
return html_output
|
18 |
-
|
19 |
def main():
|
20 |
data_list = DataList()
|
21 |
model_list = ModelList()
|
@@ -66,28 +53,7 @@ span.svelte-s1r2yt{font-weight: bold !important;
|
|
66 |
demo.load(fn=model_list.render, inputs=[search_box, case_sensitive, filter_names1, data_types1,],outputs=[table,])
|
67 |
search_box.submit(fn=model_list.render, inputs=[search_box, case_sensitive, filter_names1, data_types1,], outputs=[table,])
|
68 |
search_button.click(fn=model_list.render, inputs=[search_box, case_sensitive, filter_names1, data_types1,], outputs=[table,])
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
with gr.Tab(label="NOTEBOOKS",elem_id="nbs"):
|
73 |
-
with gr.Accordion("Building a Safety Agent using Langchain",open=False):
|
74 |
-
notebook='Building_a_Safety_Agent.ipynb'
|
75 |
-
colab_link="<a href='https://colab.research.google.com/drive/1BoxUprJQ7skeyA88gfGRVVgzsvFUwnqd?usp=sharing'><button style='box-sizing: border-box; border: 1px solid #000; padding: 5px;'>Open in Colab</button></a>"
|
76 |
-
gr.HTML(colab_link)
|
77 |
-
gr.HTML(show_notebook(notebook))
|
78 |
-
with gr.Accordion("LLM Hallucination Detection",open=False):
|
79 |
-
gr.HTML("Coming Soon")
|
80 |
-
|
81 |
-
|
82 |
-
with gr.Tab(label="METRICS",elem_id="mtcs"):
|
83 |
-
gr.HTML(value='<iframe src="https://v2-embednotion.com/Metrics-dbe5d86e2181438fb4eb1e4f01fa3955?pvs=4"></iframe> <style> iframe { width: 100%; height: 10vh; border: 2px solid #ccc; border-radius: 10px; padding: none; text-align: right; } </style>')
|
84 |
|
85 |
-
with gr.Tab(label="NIST-RAI INSTITUTE AI SAFETY RATINGS ",elem_id="nrasr"):
|
86 |
-
gr.Image(value="nist.png",scale=1,show_download_button=False,show_share_button=False,show_label=False,container=False)
|
87 |
-
|
88 |
-
with gr.Tab(label="TOOLKITS & LIBRARIES",elem_id="tlsnlbs"):
|
89 |
-
gr.HTML(value='<iframe src="https://v2-embednotion.com/Toolkits-Libraries-d5865c7ae5b0499988f5cc5fce711888?pvs=4"></iframe> <style> iframe { width: 100%; height: 10vh; border: 2px solid #ccc; border-radius: 10px; padding: none; } </style>')
|
90 |
-
|
91 |
demo.queue()
|
92 |
demo.launch(share=False)
|
93 |
|
|
|
1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
2 |
from model_list import ModelList
|
3 |
from data_list import DataList
|
4 |
|
5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
def main():
|
7 |
data_list = DataList()
|
8 |
model_list = ModelList()
|
|
|
53 |
demo.load(fn=model_list.render, inputs=[search_box, case_sensitive, filter_names1, data_types1,],outputs=[table,])
|
54 |
search_box.submit(fn=model_list.render, inputs=[search_box, case_sensitive, filter_names1, data_types1,], outputs=[table,])
|
55 |
search_button.click(fn=model_list.render, inputs=[search_box, case_sensitive, filter_names1, data_types1,], outputs=[table,])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
56 |
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
demo.queue()
|
58 |
demo.launch(share=False)
|
59 |
|