Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -4,6 +4,7 @@ import networkx as nx
|
|
4 |
import matplotlib.pyplot as plt
|
5 |
import gradio as gr
|
6 |
from io import BytesIO
|
|
|
7 |
|
8 |
# Define investors and their companies
|
9 |
investors = {
|
@@ -68,7 +69,7 @@ investor_colors = {
|
|
68 |
"Y Combinator": "black"
|
69 |
}
|
70 |
|
71 |
-
|
72 |
def generate_graph(selected_investors):
|
73 |
if not selected_investors:
|
74 |
selected_investors = list(investors.keys())
|
@@ -113,7 +114,10 @@ def generate_graph(selected_investors):
|
|
113 |
plt.savefig(buf, format="png", bbox_inches="tight")
|
114 |
plt.close()
|
115 |
buf.seek(0)
|
116 |
-
|
|
|
|
|
|
|
117 |
|
118 |
# Define Gradio interface
|
119 |
def main():
|
|
|
4 |
import matplotlib.pyplot as plt
|
5 |
import gradio as gr
|
6 |
from io import BytesIO
|
7 |
+
from PIL import Image
|
8 |
|
9 |
# Define investors and their companies
|
10 |
investors = {
|
|
|
69 |
"Y Combinator": "black"
|
70 |
}
|
71 |
|
72 |
+
|
73 |
def generate_graph(selected_investors):
|
74 |
if not selected_investors:
|
75 |
selected_investors = list(investors.keys())
|
|
|
114 |
plt.savefig(buf, format="png", bbox_inches="tight")
|
115 |
plt.close()
|
116 |
buf.seek(0)
|
117 |
+
|
118 |
+
# Convert BytesIO to PIL image
|
119 |
+
image = Image.open(buf)
|
120 |
+
return image
|
121 |
|
122 |
# Define Gradio interface
|
123 |
def main():
|