prozorov commited on
Commit
5ce61c0
·
verified ·
1 Parent(s): a27cff4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -4
app.py CHANGED
@@ -12,8 +12,8 @@ import re
12
  from markdownify import markdownify
13
  from requests.exceptions import RequestException
14
 
15
- with open('index.html', 'r', encoding='utf-8') as file:
16
- cheatsheet_template = file.read()
17
 
18
  with open('scripts.js', 'r', encoding='utf-8') as file:
19
  scripts = """
@@ -59,7 +59,9 @@ def json_string_to_poster(json_string:str)-> str:
59
 
60
  #return html_template
61
 
62
- return cheatsheet_template
 
 
63
 
64
  final_answer = FinalAnswerTool()
65
 
@@ -101,7 +103,7 @@ def get_and_visualize_data(query):
101
 
102
 
103
  # 4. Создаем Gradio интерфейс
104
- with gr.Blocks() as demo:
105
  with gr.Row():
106
  city_input = gr.Textbox(label="Topic", placeholder="Example: npm commands")
107
  submit_btn = gr.Button("Generate poster", variant="primary")
 
12
  from markdownify import markdownify
13
  from requests.exceptions import RequestException
14
 
15
+ with open('styles.css', 'r', encoding='utf-8') as file:
16
+ styles = file.read()
17
 
18
  with open('scripts.js', 'r', encoding='utf-8') as file:
19
  scripts = """
 
59
 
60
  #return html_template
61
 
62
+ return """
63
+ <div id="root"></div>
64
+ """
65
 
66
  final_answer = FinalAnswerTool()
67
 
 
103
 
104
 
105
  # 4. Создаем Gradio интерфейс
106
+ with gr.Blocks(css=styles) as demo:
107
  with gr.Row():
108
  city_input = gr.Textbox(label="Topic", placeholder="Example: npm commands")
109
  submit_btn = gr.Button("Generate poster", variant="primary")