YuWang0103 commited on
Commit
7084eba
·
verified ·
1 Parent(s): 48d9a45

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -56,7 +56,7 @@ def predict(text, num_nodes = None):
56
  avg_deg = np.mean(degs)
57
  avg_cc = np.mean(ccs)
58
 
59
- return images[0], images[1], images[2], images[3], images[4], ccs[0], ccs[1], ccs[2], ccs[3], ccs[4], degs[0], degs[1], degs[2], degs[3], degs[4], avg_cc, avg_deg
60
 
61
  def clear(input_text):
62
  return None, None
@@ -68,17 +68,17 @@ with gr.Blocks() as demo:
68
  with gr.Column():
69
  input_text = gr.Textbox(label="Input your text prompt here", placeholder="Type here...")
70
  with gr.Column():
71
- input_num = gr.Slider(5, 200, value=10, label="Count", info="Number of nodes in the graph to be generated")
72
  with gr.Column():
73
  gr.Markdown("### Suggested Prompts")
74
  gr.Markdown("1. Create a complex network with high clustering coefficient.\n2. Create a graph with extremely low number of triangles.\n 3. Please give me a Power Network with extremely low number of triangles but with medium level of average degree.")
75
 
76
  with gr.Row() as output_row:
77
- output_images = [gr.Image(label = f"Generated Network #{_}") for _ in range(5)]
78
  with gr.Row():
79
- output_texts_cc = [gr.Textbox(label=f"CC #{_}") for _ in range(5)]
80
  with gr.Row():
81
- output_texts_deg = [gr.Textbox(label=f"DEG #{_}") for _ in range(5)]
82
 
83
  with gr.Row():
84
  avg_cc_text = gr.Textbox(label="Average Clustering Coefficient")
 
56
  avg_deg = np.mean(degs)
57
  avg_cc = np.mean(ccs)
58
 
59
+ return images[0], images[1], images[2], ccs[0], ccs[1], ccs[2], degs[0], degs[1], degs[2], avg_cc, avg_deg
60
 
61
  def clear(input_text):
62
  return None, None
 
68
  with gr.Column():
69
  input_text = gr.Textbox(label="Input your text prompt here", placeholder="Type here...")
70
  with gr.Column():
71
+ input_num = gr.Slider(1, 200, value=10, label="Count", info="Number of nodes in the graph to be generated")
72
  with gr.Column():
73
  gr.Markdown("### Suggested Prompts")
74
  gr.Markdown("1. Create a complex network with high clustering coefficient.\n2. Create a graph with extremely low number of triangles.\n 3. Please give me a Power Network with extremely low number of triangles but with medium level of average degree.")
75
 
76
  with gr.Row() as output_row:
77
+ output_images = [gr.Image(label = f"Generated Network #{_}") for _ in range(3)]
78
  with gr.Row():
79
+ output_texts_cc = [gr.Textbox(label=f"CC #{_}") for _ in range(3)]
80
  with gr.Row():
81
+ output_texts_deg = [gr.Textbox(label=f"DEG #{_}") for _ in range(3)]
82
 
83
  with gr.Row():
84
  avg_cc_text = gr.Textbox(label="Average Clustering Coefficient")