openfree commited on
Commit
2a151b4
·
verified ·
1 Parent(s): 9a3747a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -3
app.py CHANGED
@@ -336,6 +336,9 @@ def create_sample_workflow(example_type="basic"):
336
  def generate_standalone_app(workflow_data: dict, app_name: str, app_description: str) -> str:
337
  """워크플로우를 독립적인 Gradio 앱으로 변환"""
338
 
 
 
 
339
  app_code = f'''"""
340
  {app_name}
341
  {app_description}
@@ -348,7 +351,7 @@ import gradio as gr
348
  import requests
349
 
350
  # Workflow configuration
351
- WORKFLOW_DATA = {json.dumps(workflow_data, indent=2)}
352
 
353
  def execute_workflow(*input_values):
354
  """Execute the workflow with given inputs"""
@@ -482,8 +485,8 @@ def execute_workflow(*input_values):
482
 
483
  # Build UI
484
  with gr.Blocks(title="{app_name}", theme=gr.themes.Soft()) as demo:
485
- gr.Markdown(f"# {{app_name}}")
486
- gr.Markdown(f"{{app_description}}")
487
 
488
  # Extract nodes
489
  nodes = WORKFLOW_DATA.get("nodes", [])
 
336
  def generate_standalone_app(workflow_data: dict, app_name: str, app_description: str) -> str:
337
  """워크플로우를 독립적인 Gradio 앱으로 변환"""
338
 
339
+ # JSON 데이터를 문자열로 변환
340
+ workflow_json = json.dumps(workflow_data, indent=2)
341
+
342
  app_code = f'''"""
343
  {app_name}
344
  {app_description}
 
351
  import requests
352
 
353
  # Workflow configuration
354
+ WORKFLOW_DATA = {workflow_json}
355
 
356
  def execute_workflow(*input_values):
357
  """Execute the workflow with given inputs"""
 
485
 
486
  # Build UI
487
  with gr.Blocks(title="{app_name}", theme=gr.themes.Soft()) as demo:
488
+ gr.Markdown("# {app_name}")
489
+ gr.Markdown("{app_description}")
490
 
491
  # Extract nodes
492
  nodes = WORKFLOW_DATA.get("nodes", [])