Spaces:
Sleeping
Sleeping
fabianbeigang
commited on
Commit
•
c43e57f
1
Parent(s):
343a814
Initial commit
Browse files- README.md +5 -5
- app.py +140 -0
- requirements.txt +2 -0
README.md
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
emoji:
|
4 |
-
colorFrom:
|
5 |
-
colorTo:
|
6 |
sdk: gradio
|
7 |
-
sdk_version: 4.
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
---
|
|
|
1 |
---
|
2 |
+
title: Emailui
|
3 |
+
emoji: 😻
|
4 |
+
colorFrom: gray
|
5 |
+
colorTo: blue
|
6 |
sdk: gradio
|
7 |
+
sdk_version: 4.31.2
|
8 |
app_file: app.py
|
9 |
pinned: false
|
10 |
---
|
app.py
ADDED
@@ -0,0 +1,140 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# import gradio as gr
|
2 |
+
# import requests
|
3 |
+
|
4 |
+
# # Function to call the API and process the response
|
5 |
+
# def get_investment_insights(company_name, work_phone, headquarters, asset_class, primary_location,
|
6 |
+
# investment_vehicle_country, vehicle_currency, holding_period, esg_membership,
|
7 |
+
# investment_structure, capital_target, target_irr, target_equity_multiple,
|
8 |
+
# min_investment_size, investment_strategy, fund_status):
|
9 |
+
# url = "https://01bpjt0euk.execute-api.us-east-1.amazonaws.com/default/investment_thesis_and_rationale"
|
10 |
+
# payload = {'company_details': {
|
11 |
+
# "company_name": company_name,
|
12 |
+
# "work_phone": work_phone,
|
13 |
+
# "headquarters": headquarters,
|
14 |
+
# "asset_class": asset_class,
|
15 |
+
# "primary_location": primary_location,
|
16 |
+
# "investment_vehicle_country": investment_vehicle_country,
|
17 |
+
# "vehicle_currency": vehicle_currency,
|
18 |
+
# "holding_period": holding_period,
|
19 |
+
# "esg_membership": esg_membership,
|
20 |
+
# "investment_structure": investment_structure,
|
21 |
+
# "capital_target": capital_target,
|
22 |
+
# "target_irr": target_irr,
|
23 |
+
# "target_equity_multiple": target_equity_multiple,
|
24 |
+
# "min_investment_size": min_investment_size,
|
25 |
+
# "investment_strategy": investment_strategy,
|
26 |
+
# "fund_status": fund_status
|
27 |
+
# }}
|
28 |
+
# response = requests.post(url, json=payload)
|
29 |
+
# print(response.json())
|
30 |
+
# if response.status_code == 200:
|
31 |
+
# response_data = response.json()
|
32 |
+
# return response_data.get('investment_rationale', ''), response_data.get('subsectors_of_focus', ''), response_data.get('investment_criteria_and_selection_process', '')
|
33 |
+
# else:
|
34 |
+
# return "API request failed", "", ""
|
35 |
+
|
36 |
+
# # Gradio interface
|
37 |
+
# with gr.Blocks() as app:
|
38 |
+
# gr.Markdown("# Investment Insights Extractor")
|
39 |
+
|
40 |
+
# company_name = gr.Textbox(label="Your Company's Name", value="Example Company")
|
41 |
+
# work_phone = gr.Textbox(label="Your Work Phone Number", value="+1234567890")
|
42 |
+
# headquarters = gr.Textbox(label="Where are your company's headquarters?", value="New York, USA")
|
43 |
+
# asset_class = gr.Textbox(label="In which Asset Class are you investing?", value="Private Equity")
|
44 |
+
# primary_location = gr.Textbox(label="Where are you investing primarily?", value="North America")
|
45 |
+
# investment_vehicle_country = gr.Textbox(label="In what Country is your investment vehicle domiciled?", value="USA")
|
46 |
+
# vehicle_currency = gr.Textbox(label="What is the investment vehicle's currency?", value="USD")
|
47 |
+
# holding_period = gr.Textbox(label="What is the expected holding period (in years)?", value="5")
|
48 |
+
# esg_membership = gr.Dropdown(choices=["Yes", "No"], label="Are you a member of any ESG associations?", value="Yes")
|
49 |
+
# investment_structure = gr.Textbox(label="What is your Investment Structure?", value="Fund")
|
50 |
+
# capital_target = gr.Textbox(label="What is the total capital raising target for your offering (In USD Millions)?", value="100")
|
51 |
+
# target_irr = gr.Textbox(label="What is your target gross return (IRR %)?", value="15")
|
52 |
+
# target_equity_multiple = gr.Textbox(label="What is your target gross Equity Multiple / MOIC (x)?", value="2")
|
53 |
+
# min_investment_size = gr.Textbox(label="What is the minimum investment ticket size acceptable (In USD Millions)?", value="1")
|
54 |
+
# investment_strategy = gr.Textbox(label="Describe your investment strategy", value="Focus on growth-stage technology companies", lines=5)
|
55 |
+
# fund_status = gr.Textbox(label="What is your fund status?", value="Open")
|
56 |
+
|
57 |
+
# investment_rationale = gr.Textbox(label="Investment Rationale", interactive=False)
|
58 |
+
# subsectors_of_focus = gr.Textbox(label="Subsectors of Focus", interactive=False)
|
59 |
+
# investment_criteria_and_selection_process = gr.Textbox(label="Investment Criteria and Selection Process", interactive=False)
|
60 |
+
|
61 |
+
# submit_btn = gr.Button("Get Insights")
|
62 |
+
# submit_btn.click(get_investment_insights,
|
63 |
+
# [company_name, work_phone, headquarters, asset_class, primary_location, investment_vehicle_country,
|
64 |
+
# vehicle_currency, holding_period, esg_membership, investment_structure, capital_target,
|
65 |
+
# target_irr, target_equity_multiple, min_investment_size, investment_strategy, fund_status],
|
66 |
+
# [investment_rationale, subsectors_of_focus, investment_criteria_and_selection_process])
|
67 |
+
|
68 |
+
# app.launch()
|
69 |
+
|
70 |
+
import gradio as gr
|
71 |
+
import requests
|
72 |
+
|
73 |
+
# Function to call the API and process the response
|
74 |
+
def get_investment_insights(company_name, work_phone, headquarters, asset_class, primary_location,
|
75 |
+
investment_vehicle_country, vehicle_currency, holding_period, esg_membership,
|
76 |
+
investment_structure, capital_target, target_irr, target_equity_multiple,
|
77 |
+
min_investment_size, investment_strategy, fund_status):
|
78 |
+
url = "https://01bpjt0euk.execute-api.us-east-1.amazonaws.com/default/investment_thesis_and_rationale"
|
79 |
+
payload = {'company_details': {
|
80 |
+
"company_name": company_name,
|
81 |
+
"work_phone": work_phone,
|
82 |
+
"headquarters": headquarters,
|
83 |
+
"asset_class": asset_class,
|
84 |
+
"primary_location": primary_location,
|
85 |
+
"investment_vehicle_country": investment_vehicle_country,
|
86 |
+
"vehicle_currency": vehicle_currency,
|
87 |
+
"holding_period": holding_period,
|
88 |
+
"esg_membership": esg_membership,
|
89 |
+
"investment_structure": investment_structure,
|
90 |
+
"capital_target": capital_target,
|
91 |
+
"target_irr": target_irr,
|
92 |
+
"target_equity_multiple": target_equity_multiple,
|
93 |
+
"min_investment_size": min_investment_size,
|
94 |
+
"investment_strategy": investment_strategy,
|
95 |
+
"fund_status": fund_status
|
96 |
+
}}
|
97 |
+
response = requests.post(url, json=payload)
|
98 |
+
print(response.json())
|
99 |
+
if response.status_code == 200:
|
100 |
+
response_data = response.json()
|
101 |
+
return response_data.get('investment_rationale', ''), response_data.get('subsectors_of_focus', ''), response_data.get('investment_criteria_and_selection_process', '')
|
102 |
+
else:
|
103 |
+
return "API request failed", "", ""
|
104 |
+
|
105 |
+
# Gradio interface
|
106 |
+
with gr.Blocks() as app:
|
107 |
+
gr.Markdown("# Investment Insights Extractor")
|
108 |
+
|
109 |
+
with gr.Row():
|
110 |
+
with gr.Column():
|
111 |
+
company_name = gr.Textbox(label="Your Company's Name", value="Example Company")
|
112 |
+
work_phone = gr.Textbox(label="Your Work Phone Number", value="+1234567890")
|
113 |
+
headquarters = gr.Textbox(label="Where are your company's headquarters?", value="New York, USA")
|
114 |
+
asset_class = gr.Textbox(label="In which Asset Class are you investing?", value="Private Equity")
|
115 |
+
primary_location = gr.Textbox(label="Where are you investing primarily?", value="North America")
|
116 |
+
investment_vehicle_country = gr.Textbox(label="In what Country is your investment vehicle domiciled?", value="USA")
|
117 |
+
vehicle_currency = gr.Textbox(label="What is the investment vehicle's currency?", value="USD")
|
118 |
+
holding_period = gr.Textbox(label="What is the expected holding period (in years)?", value="5")
|
119 |
+
esg_membership = gr.Dropdown(choices=["Yes", "No"], label="Are you a member of any ESG associations?", value="Yes")
|
120 |
+
investment_structure = gr.Textbox(label="What is your Investment Structure?", value="Fund")
|
121 |
+
capital_target = gr.Textbox(label="What is the total capital raising target for your offering (In USD Millions)?", value="100")
|
122 |
+
target_irr = gr.Textbox(label="What is your target gross return (IRR %)?", value="15")
|
123 |
+
target_equity_multiple = gr.Textbox(label="What is your target gross Equity Multiple / MOIC (x)?", value="2")
|
124 |
+
min_investment_size = gr.Textbox(label="What is the minimum investment ticket size acceptable (In USD Millions)?", value="1")
|
125 |
+
investment_strategy = gr.Textbox(label="Describe your investment strategy", value="Focus on growth-stage technology companies", lines=5)
|
126 |
+
fund_status = gr.Textbox(label="What is your fund status?", value="Open")
|
127 |
+
|
128 |
+
with gr.Column():
|
129 |
+
investment_rationale = gr.Textbox(label="Investment Rationale", interactive=False)
|
130 |
+
subsectors_of_focus = gr.Textbox(label="Subsectors of Focus", interactive=False)
|
131 |
+
investment_criteria_and_selection_process = gr.Textbox(label="Investment Criteria and Selection Process", interactive=False)
|
132 |
+
|
133 |
+
submit_btn = gr.Button("Get Insights")
|
134 |
+
submit_btn.click(get_investment_insights,
|
135 |
+
[company_name, work_phone, headquarters, asset_class, primary_location, investment_vehicle_country,
|
136 |
+
vehicle_currency, holding_period, esg_membership, investment_structure, capital_target,
|
137 |
+
target_irr, target_equity_multiple, min_investment_size, investment_strategy, fund_status],
|
138 |
+
[investment_rationale, subsectors_of_focus, investment_criteria_and_selection_process])
|
139 |
+
|
140 |
+
app.launch()
|
requirements.txt
ADDED
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
1 |
+
gradio
|
2 |
+
requests
|