Update app.py
Browse files
app.py
CHANGED
@@ -7,7 +7,6 @@ import asyncio
|
|
7 |
import sqlite3
|
8 |
import json
|
9 |
import gradio as gr
|
10 |
-
from bs4 import BeautifulSoup
|
11 |
from gradio_client import Client
|
12 |
import time
|
13 |
|
@@ -23,17 +22,6 @@ stop = asyncio.Future()
|
|
23 |
messageTextbox = None
|
24 |
serverMessageTextbox = None
|
25 |
|
26 |
-
def slow_echo(message, history):
|
27 |
-
for i in range(len(message)):
|
28 |
-
time.sleep(0.3)
|
29 |
-
yield "You typed: " + message[: i+1]
|
30 |
-
|
31 |
-
# Define a function to read the HTML file
|
32 |
-
def read_html_file(file_name):
|
33 |
-
with open(file_name, 'r') as file:
|
34 |
-
html_content = file.read()
|
35 |
-
return html_content
|
36 |
-
|
37 |
# Set up the HTTP server
|
38 |
class SimpleHTTPRequestHandler(http.server.SimpleHTTPRequestHandler):
|
39 |
def do_GET(self):
|
@@ -182,11 +170,6 @@ async def start_websockets(websocketPort):
|
|
182 |
print(f"Starting WebSocket server on port {websocketPort}...")
|
183 |
return "Used ports:\n" + '\n'.join(map(str, used_ports))
|
184 |
|
185 |
-
def create_iframe():
|
186 |
-
# Create an iframe with your HTML content
|
187 |
-
iframe_code = f'<iframe srcdoc="{htmlStr}" width="70%" height="70%"></iframe>'
|
188 |
-
return iframe_code
|
189 |
-
|
190 |
with gr.Blocks() as demo:
|
191 |
|
192 |
with gr.Column(scale=1, min_width=600):
|
|
|
7 |
import sqlite3
|
8 |
import json
|
9 |
import gradio as gr
|
|
|
10 |
from gradio_client import Client
|
11 |
import time
|
12 |
|
|
|
22 |
messageTextbox = None
|
23 |
serverMessageTextbox = None
|
24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
# Set up the HTTP server
|
26 |
class SimpleHTTPRequestHandler(http.server.SimpleHTTPRequestHandler):
|
27 |
def do_GET(self):
|
|
|
170 |
print(f"Starting WebSocket server on port {websocketPort}...")
|
171 |
return "Used ports:\n" + '\n'.join(map(str, used_ports))
|
172 |
|
|
|
|
|
|
|
|
|
|
|
173 |
with gr.Blocks() as demo:
|
174 |
|
175 |
with gr.Column(scale=1, min_width=600):
|