File size: 1,185 Bytes
3abf67f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import sys

root_dir = __file__.rsplit("/", 2)[0]
if root_dir not in sys.path:
    sys.path.append(root_dir)

import gradio as gr
import os
import requests

from gradio.themes import *


# Build demo
with gr.Blocks(title="SaprotHub", fill_width=True) as demo:
    # models = retrieve_models()
    # datasets = retrieve_datasets()
    # print(models)
    # print(datasets)
    gr.Label("Subsection of text", visible=True)
    # subsection_type = gr.Dropdown(models, label="Search models", interactive=True, scale=0)
    # url = "https://hf-mirror.com/SaProtHub/Model-Thermostability-650M"
    url = "https://www.uniprot.org/uniprotkb/P05067"
    # url = "https://huggingface.co/SaProtHub/Model-Thermostability-650M"
    url = "https://www.baidu.com"
    response = requests.get(url)
    # print(response.text)
    # gr.HTML(response.text)
    # iframe = f'<iframe srcdoc="{response.text}" width="100%"></iframe>'
    iframe = f'<iframe src="{url}" width="100%" height="800"></iframe>'
    # HTML = gr.HTML(open("/root/PycharmProjects/SaprotHub/hub_demo/test.html").read())
    HTML = gr.HTML(iframe)


if __name__ == '__main__':
    # Run the demo
    demo.launch(server_name="0.0.0.0")