danhtran2mind commited on
Commit
6430bee
·
verified ·
1 Parent(s): 06622af

Update gradio_app.py

Browse files
Files changed (1) hide show
  1. gradio_app.py +4 -9
gradio_app.py CHANGED
@@ -19,15 +19,10 @@ DESCRIPTION = '''
19
  </div>
20
  '''
21
 
22
- import seedir as sd
23
- sd.seedir(".")
24
 
25
- # Read CSS content
26
- with open("gradio_app/static/style.css", "r") as file:
27
- CSS = file.read()
28
- file.close()
29
-
30
- JS_PATH = "gradio_app/static/script.js"
31
 
32
  def user(message, history):
33
  if not isinstance(history, list):
@@ -37,7 +32,7 @@ def user(message, history):
37
  def create_ui(model_handler):
38
  with gr.Blocks(css=CSS, theme=gr.themes.Default()) as demo:
39
  gr.Markdown(DESCRIPTION)
40
- gr.HTML(f'<script src={JS_PATH}></script>')
41
  active_gen = gr.State([False])
42
  model_handler_state = gr.State(model_handler)
43
 
 
19
  </div>
20
  '''
21
 
22
+ # Replace external CSS fetch with local file
23
+ CSS = open("gradio_app/static/styles.css").read()
24
 
25
+ # JS_PATH = "gradio_app/static/script.js"
 
 
 
 
 
26
 
27
  def user(message, history):
28
  if not isinstance(history, list):
 
32
  def create_ui(model_handler):
33
  with gr.Blocks(css=CSS, theme=gr.themes.Default()) as demo:
34
  gr.Markdown(DESCRIPTION)
35
+ gr.HTML('<script src="file=gradio_app/static/script.js"></script>')
36
  active_gen = gr.State([False])
37
  model_handler_state = gr.State(model_handler)
38