Spaces:
Running
Running
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import sys
|
2 |
+
|
3 |
+
root_dir = __file__.rsplit("/", 2)[0]
|
4 |
+
if root_dir not in sys.path:
|
5 |
+
sys.path.append(root_dir)
|
6 |
+
|
7 |
+
import gradio as gr
|
8 |
+
import os
|
9 |
+
import requests
|
10 |
+
|
11 |
+
from gradio.themes import *
|
12 |
+
|
13 |
+
|
14 |
+
# Build demo
|
15 |
+
with gr.Blocks(title="SaprotHub", fill_width=True) as demo:
|
16 |
+
# models = retrieve_models()
|
17 |
+
# datasets = retrieve_datasets()
|
18 |
+
# print(models)
|
19 |
+
# print(datasets)
|
20 |
+
gr.Label("Subsection of text", visible=True)
|
21 |
+
# subsection_type = gr.Dropdown(models, label="Search models", interactive=True, scale=0)
|
22 |
+
# url = "https://hf-mirror.com/SaProtHub/Model-Thermostability-650M"
|
23 |
+
url = "https://www.uniprot.org/uniprotkb/P05067"
|
24 |
+
# url = "https://huggingface.co/SaProtHub/Model-Thermostability-650M"
|
25 |
+
url = "https://www.baidu.com"
|
26 |
+
response = requests.get(url)
|
27 |
+
# print(response.text)
|
28 |
+
# gr.HTML(response.text)
|
29 |
+
# iframe = f'<iframe srcdoc="{response.text}" width="100%"></iframe>'
|
30 |
+
iframe = f'<iframe src="{url}" width="100%" height="800"></iframe>'
|
31 |
+
# HTML = gr.HTML(open("/root/PycharmProjects/SaprotHub/hub_demo/test.html").read())
|
32 |
+
HTML = gr.HTML(iframe)
|
33 |
+
|
34 |
+
|
35 |
+
if __name__ == '__main__':
|
36 |
+
# Run the demo
|
37 |
+
demo.launch(server_name="0.0.0.0")
|