Spaces:
Sleeping
Sleeping
Doubleupai
commited on
Commit
•
1bfd284
1
Parent(s):
8b8eb83
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
|
3 |
+
def generate_website(name, description):
|
4 |
+
# Simple HTML template generation
|
5 |
+
html_code = f"""
|
6 |
+
<!DOCTYPE html>
|
7 |
+
<html>
|
8 |
+
<head>
|
9 |
+
<title>{name}</title>
|
10 |
+
</head>
|
11 |
+
<body>
|
12 |
+
<h1>{name}</h1>
|
13 |
+
<p>{description}</p>
|
14 |
+
</body>
|
15 |
+
</html>
|
16 |
+
"""
|
17 |
+
return html_code
|
18 |
+
|
19 |
+
iface = gr.Interface(
|
20 |
+
fn=generate_website,
|
21 |
+
inputs=[
|
22 |
+
gr.Textbox(label="Website Name"),
|
23 |
+
gr.Textbox(label="Website Description"),
|
24 |
+
],
|
25 |
+
outputs=gr.Textbox(label="Generated HTML Code"),
|
26 |
+
title="AI Website Generator",
|
27 |
+
description="Generate a simple HTML website with AI.",
|
28 |
+
theme="macos",
|
29 |
+
css=".gradio-container {background-color: #f0f0f0;}"
|
30 |
+
)
|
31 |
+
|
32 |
+
iface.launch()
|