Update app.py
Browse files
app.py
CHANGED
@@ -1,21 +1,18 @@
|
|
1 |
import gradio as gr
|
2 |
-
from transformers import pipeline
|
3 |
|
4 |
-
def
|
5 |
-
return gr.outputs.HTML(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
iface = gr.Interface(
|
11 |
-
fn=hugging_face_fn,
|
12 |
-
inputs=gr.inputs.Textbox(label="Enter HTML frame here"),
|
13 |
-
outputs="html",
|
14 |
-
title="HTML Frame Embedder",
|
15 |
-
description="Input an HTML frame and see it embedded below."
|
16 |
-
)
|
17 |
-
|
18 |
-
model = pipeline("text-generation", model="gpt2")
|
19 |
-
model.add_pipe(iface)
|
20 |
-
|
21 |
-
model("Hello world! This is an HTML frame <iframe src='https://www.example.com'></iframe>")
|
|
|
1 |
import gradio as gr
|
|
|
2 |
|
3 |
+
def embed_widget_code():
|
4 |
+
return gr.outputs.HTML('''
|
5 |
+
<!--OST Widget code start-->
|
6 |
+
<div style="text-align:right;">
|
7 |
+
<div style="min-height:360px;">
|
8 |
+
<div style="width:100%;height:0;padding-bottom:50%;position:relative;">
|
9 |
+
<iframe style="border:none;position:absolute;top:0;left:0;width:100%;height:100%;min-height:360px;border:none;overflow:hidden !important;" src="//openspeedtest.com/speedtest"></iframe>
|
10 |
+
</div>
|
11 |
+
</div>
|
12 |
+
Provided by <a href="https://openspeedtest.com">OpenSpeedtest.com</a>
|
13 |
+
</div>
|
14 |
+
<!-- OST Widget code end -->
|
15 |
+
''')
|
16 |
|
17 |
+
iface = gr.Interface(embed_widget_code, "text")
|
18 |
+
iface.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|