Spaces:
Runtime error
Runtime error
Michelangiolo
commited on
Commit
•
3d4e8d2
1
Parent(s):
2b957e7
changes
Browse files- _test.ipynb +58 -9
- app.py +9 -6
_test.ipynb
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
"cells": [
|
3 |
{
|
4 |
"cell_type": "code",
|
5 |
-
"execution_count":
|
6 |
"metadata": {},
|
7 |
"outputs": [],
|
8 |
"source": [
|
@@ -66,9 +66,55 @@
|
|
66 |
},
|
67 |
{
|
68 |
"cell_type": "code",
|
69 |
-
"execution_count":
|
70 |
"metadata": {},
|
71 |
-
"outputs": [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
72 |
"source": [
|
73 |
"#the first module becomes text1, the second module file1\n",
|
74 |
"def greet(size, target, stage, query): \n",
|
@@ -80,20 +126,23 @@
|
|
80 |
" df_knn = search(df, query)\n",
|
81 |
" df_knn['raised'] = df_knn['raised'].apply(lambda x : raised_zero(x))\n",
|
82 |
"\n",
|
83 |
-
"
|
|
|
84 |
" if stage != 'ALL':\n",
|
85 |
-
" df_stage = filter_df(
|
86 |
" else:\n",
|
87 |
" #we bypass the filter\n",
|
88 |
-
" df_stage =
|
|
|
|
|
89 |
"\n",
|
90 |
-
"
|
91 |
" \n",
|
92 |
" # display(df_stage)\n",
|
93 |
" # df_raised = df_target[(df_target['raised'] >= raised) | (df_target['raised'] == 0)]\n",
|
94 |
"\n",
|
95 |
" #we live the sorting for last\n",
|
96 |
-
" return
|
97 |
"\n",
|
98 |
"with gr.Blocks(theme=gr.themes.Soft(primary_hue='amber', secondary_hue='gray', neutral_hue='amber')) as demo:\n",
|
99 |
" gr.Markdown(\n",
|
@@ -103,7 +152,7 @@
|
|
103 |
" )\n",
|
104 |
" size = gr.Radio(['1-10', '11-50', '51-200', '201-500', '500+', '11-500+'], multiselect=False, value='11-500+', label='size')\n",
|
105 |
" target = gr.Radio(['B2B', 'B2C', 'B2G', 'B2B2C'], multiselect=False, value='B2B', label='target')\n",
|
106 |
-
" stage = gr.Radio(['pre-seed', 'A', 'B', 'C', '
|
107 |
" # raised = gr.Slider(0, 20, value=5, step_size=1, label=\"Minimum raising (in Millions)\")\n",
|
108 |
" query = gr.Textbox(label='Describe the Startup you are searching for', value='age reversing')\n",
|
109 |
" btn = gr.Button(value=\"Search for a Startup\")\n",
|
|
|
2 |
"cells": [
|
3 |
{
|
4 |
"cell_type": "code",
|
5 |
+
"execution_count": null,
|
6 |
"metadata": {},
|
7 |
"outputs": [],
|
8 |
"source": [
|
|
|
66 |
},
|
67 |
{
|
68 |
"cell_type": "code",
|
69 |
+
"execution_count": 75,
|
70 |
"metadata": {},
|
71 |
+
"outputs": [
|
72 |
+
{
|
73 |
+
"name": "stderr",
|
74 |
+
"output_type": "stream",
|
75 |
+
"text": [
|
76 |
+
"c:\\Users\\ardit\\AppData\\Local\\Programs\\Python\\Python39\\lib\\site-packages\\gradio\\deprecation.py:43: UserWarning: You have unused kwarg parameters in Radio, please remove them: {'multiselect': False}\n",
|
77 |
+
" warnings.warn(\n"
|
78 |
+
]
|
79 |
+
},
|
80 |
+
{
|
81 |
+
"name": "stdout",
|
82 |
+
"output_type": "stream",
|
83 |
+
"text": [
|
84 |
+
"Running on local URL: http://127.0.0.1:7909\n",
|
85 |
+
"\n",
|
86 |
+
"To create a public link, set `share=True` in `launch()`.\n"
|
87 |
+
]
|
88 |
+
},
|
89 |
+
{
|
90 |
+
"data": {
|
91 |
+
"text/html": [
|
92 |
+
"<div><iframe src=\"http://127.0.0.1:7909/\" width=\"100%\" height=\"500\" allow=\"autoplay; camera; microphone; clipboard-read; clipboard-write;\" frameborder=\"0\" allowfullscreen></iframe></div>"
|
93 |
+
],
|
94 |
+
"text/plain": [
|
95 |
+
"<IPython.core.display.HTML object>"
|
96 |
+
]
|
97 |
+
},
|
98 |
+
"metadata": {},
|
99 |
+
"output_type": "display_data"
|
100 |
+
},
|
101 |
+
{
|
102 |
+
"data": {
|
103 |
+
"text/plain": []
|
104 |
+
},
|
105 |
+
"execution_count": 75,
|
106 |
+
"metadata": {},
|
107 |
+
"output_type": "execute_result"
|
108 |
+
},
|
109 |
+
{
|
110 |
+
"name": "stdout",
|
111 |
+
"output_type": "stream",
|
112 |
+
"text": [
|
113 |
+
"459\n",
|
114 |
+
"27\n"
|
115 |
+
]
|
116 |
+
}
|
117 |
+
],
|
118 |
"source": [
|
119 |
"#the first module becomes text1, the second module file1\n",
|
120 |
"def greet(size, target, stage, query): \n",
|
|
|
126 |
" df_knn = search(df, query)\n",
|
127 |
" df_knn['raised'] = df_knn['raised'].apply(lambda x : raised_zero(x))\n",
|
128 |
"\n",
|
129 |
+
" df_size = filter_df(df_knn, 'size', '==', size, 1)\n",
|
130 |
+
"\n",
|
131 |
" if stage != 'ALL':\n",
|
132 |
+
" df_stage = filter_df(df_size, 'stage', '==', stage.lower(), 1)\n",
|
133 |
" else:\n",
|
134 |
" #we bypass the filter\n",
|
135 |
+
" df_stage = df_size\n",
|
136 |
+
"\n",
|
137 |
+
" print(df_stage.size)\n",
|
138 |
"\n",
|
139 |
+
" df_target = filter_df(df_stage, 'target', 'contains', target, 1)\n",
|
140 |
" \n",
|
141 |
" # display(df_stage)\n",
|
142 |
" # df_raised = df_target[(df_target['raised'] >= raised) | (df_target['raised'] == 0)]\n",
|
143 |
"\n",
|
144 |
" #we live the sorting for last\n",
|
145 |
+
" return df_target[0:100] #.sort_values('raised', ascending=False)\n",
|
146 |
"\n",
|
147 |
"with gr.Blocks(theme=gr.themes.Soft(primary_hue='amber', secondary_hue='gray', neutral_hue='amber')) as demo:\n",
|
148 |
" gr.Markdown(\n",
|
|
|
152 |
" )\n",
|
153 |
" size = gr.Radio(['1-10', '11-50', '51-200', '201-500', '500+', '11-500+'], multiselect=False, value='11-500+', label='size')\n",
|
154 |
" target = gr.Radio(['B2B', 'B2C', 'B2G', 'B2B2C'], multiselect=False, value='B2B', label='target')\n",
|
155 |
+
" stage = gr.Radio(['pre-seed', 'A', 'B', 'C', 'ALL'], multiselect=False, value='ALL', label='stage')\n",
|
156 |
" # raised = gr.Slider(0, 20, value=5, step_size=1, label=\"Minimum raising (in Millions)\")\n",
|
157 |
" query = gr.Textbox(label='Describe the Startup you are searching for', value='age reversing')\n",
|
158 |
" btn = gr.Button(value=\"Search for a Startup\")\n",
|
app.py
CHANGED
@@ -65,20 +65,23 @@ def greet(size, target, stage, query):
|
|
65 |
df_knn = search(df, query)
|
66 |
df_knn['raised'] = df_knn['raised'].apply(lambda x : raised_zero(x))
|
67 |
|
68 |
-
|
|
|
69 |
if stage != 'ALL':
|
70 |
-
df_stage = filter_df(
|
71 |
else:
|
72 |
#we bypass the filter
|
73 |
-
df_stage =
|
|
|
|
|
74 |
|
75 |
-
|
76 |
|
77 |
# display(df_stage)
|
78 |
# df_raised = df_target[(df_target['raised'] >= raised) | (df_target['raised'] == 0)]
|
79 |
|
80 |
#we live the sorting for last
|
81 |
-
return
|
82 |
|
83 |
with gr.Blocks(theme=gr.themes.Soft(primary_hue='amber', secondary_hue='gray', neutral_hue='amber')) as demo:
|
84 |
gr.Markdown(
|
@@ -88,7 +91,7 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue='amber', secondary_hue='gray', n
|
|
88 |
)
|
89 |
size = gr.Radio(['1-10', '11-50', '51-200', '201-500', '500+', '11-500+'], multiselect=False, value='11-500+', label='size')
|
90 |
target = gr.Radio(['B2B', 'B2C', 'B2G', 'B2B2C'], multiselect=False, value='B2B', label='target')
|
91 |
-
stage = gr.Radio(['pre-seed', 'A', 'B', 'C', '
|
92 |
# raised = gr.Slider(0, 20, value=5, step_size=1, label="Minimum raising (in Millions)")
|
93 |
query = gr.Textbox(label='Describe the Startup you are searching for', value='age reversing')
|
94 |
btn = gr.Button(value="Search for a Startup")
|
|
|
65 |
df_knn = search(df, query)
|
66 |
df_knn['raised'] = df_knn['raised'].apply(lambda x : raised_zero(x))
|
67 |
|
68 |
+
df_size = filter_df(df_knn, 'size', '==', size, 1)
|
69 |
+
|
70 |
if stage != 'ALL':
|
71 |
+
df_stage = filter_df(df_size, 'stage', '==', stage.lower(), 1)
|
72 |
else:
|
73 |
#we bypass the filter
|
74 |
+
df_stage = df_size
|
75 |
+
|
76 |
+
print(df_stage.size)
|
77 |
|
78 |
+
df_target = filter_df(df_stage, 'target', 'contains', target, 1)
|
79 |
|
80 |
# display(df_stage)
|
81 |
# df_raised = df_target[(df_target['raised'] >= raised) | (df_target['raised'] == 0)]
|
82 |
|
83 |
#we live the sorting for last
|
84 |
+
return df_target[0:100] #.sort_values('raised', ascending=False)
|
85 |
|
86 |
with gr.Blocks(theme=gr.themes.Soft(primary_hue='amber', secondary_hue='gray', neutral_hue='amber')) as demo:
|
87 |
gr.Markdown(
|
|
|
91 |
)
|
92 |
size = gr.Radio(['1-10', '11-50', '51-200', '201-500', '500+', '11-500+'], multiselect=False, value='11-500+', label='size')
|
93 |
target = gr.Radio(['B2B', 'B2C', 'B2G', 'B2B2C'], multiselect=False, value='B2B', label='target')
|
94 |
+
stage = gr.Radio(['pre-seed', 'A', 'B', 'C', 'ALL'], multiselect=False, value='ALL', label='stage')
|
95 |
# raised = gr.Slider(0, 20, value=5, step_size=1, label="Minimum raising (in Millions)")
|
96 |
query = gr.Textbox(label='Describe the Startup you are searching for', value='age reversing')
|
97 |
btn = gr.Button(value="Search for a Startup")
|