m7n commited on
Commit
30ba848
·
1 Parent(s): ba5148a

improved htmll

Browse files
Files changed (1) hide show
  1. app.py +8 -2
app.py CHANGED
@@ -20,12 +20,18 @@ def predict(request: gr.Request,text_input):
20
  print(file_path)
21
  with open(file_path, "w") as f:
22
  f.write(f"""
 
 
 
23
  <script src="https://cdn.tailwindcss.com"></script>
24
- <body class="bg-gray-200 dark:text-white dark:bg-gray-900">
 
25
  <h1 class="text-3xl font-bold">
26
- Hello <i>{text_input}</i> From Gradio Iframe
27
  </h1>
28
  <h3>Filename: {file_name}</h3>
 
 
29
  """)
30
  iframe = f"""<iframe src="file={file_path}" width="100%" height="500px"></iframe>"""
31
  link = f'<a href="file={file_path}" target="_blank">{file_name}</a>'
 
20
  print(file_path)
21
  with open(file_path, "w") as f:
22
  f.write(f"""
23
+ <!DOCTYPE html>
24
+ <html>
25
+ <head>
26
  <script src="https://cdn.tailwindcss.com"></script>
27
+ </head>
28
+ <body class="bg-gray-200 dark:text-white dark:bg-gray-900">
29
  <h1 class="text-3xl font-bold">
30
+ Hello <i>{text_input}</i> From Gradio Iframe
31
  </h1>
32
  <h3>Filename: {file_name}</h3>
33
+ </body>
34
+ </html>
35
  """)
36
  iframe = f"""<iframe src="file={file_path}" width="100%" height="500px"></iframe>"""
37
  link = f'<a href="file={file_path}" target="_blank">{file_name}</a>'