anktechsol commited on
Commit
2017640
Β·
verified Β·
1 Parent(s): 006db03

feat: replace lead capture with mailto architecture request flow

Browse files
Files changed (1) hide show
  1. app.py +35 -18
app.py CHANGED
@@ -1,6 +1,7 @@
1
  import gradio as gr
2
  import requests
3
  import os
 
4
 
5
  NL = chr(10)
6
 
@@ -57,7 +58,6 @@ def fetch_top_models(tasks, license_filter=None, top_n=5):
57
  def format_model_table(models):
58
  if not models:
59
  return "No models found via HF API. Please try again."
60
-
61
  header = "| # | Model | Task | Downloads | Likes |" + NL
62
  header += "|---|-------|------|-----------|-------|" + NL
63
  rows = ""
@@ -82,10 +82,10 @@ def recommend_model(
82
  if t not in seen_t:
83
  seen_t.add(t)
84
  unique_tasks.append(t)
85
-
86
  if not unique_tasks:
87
  unique_tasks = ["text-generation"]
88
-
89
  license_filter = LICENSE_FILTER.get(data_sensitivity)
90
 
91
  # Fetch live models
@@ -127,7 +127,7 @@ def recommend_model(
127
 
128
  tasks_label = ", ".join(f"`{t}`" for t in unique_tasks)
129
  license_label = f"license: `{license_filter}`" if license_filter else "all licenses"
130
-
131
  summary = (
132
  "## πŸŽ‰ Your Live AI Model Strategy" + NL + NL +
133
  "### πŸ“¦ Top Models on HuggingFace Hub Right Now" + NL +
@@ -144,8 +144,21 @@ def recommend_model(
144
 
145
  def handle_lead(name, email, company, infra):
146
  if not email:
147
- return "Please provide an email to receive your architecture PDF."
148
- return f"βœ… Thanks {name}! We've queued your custom architecture PDF for {company}. Check your inbox at {email} shortly."
 
 
 
 
 
 
 
 
 
 
 
 
 
149
 
150
  with gr.Blocks(theme=gr.themes.Soft(primary_hue="orange", secondary_hue="slate"), title="AI Model Picker | AnkTechsol") as demo:
151
  gr.Markdown("# πŸš€ AI Model Selection Wizard")
@@ -157,7 +170,7 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue="orange", secondary_hue="slate")
157
  modality = gr.CheckboxGroup(label="What inputs are you working with?", choices=["Text in -> text out", "Images in (docs, UI, scans)", "Audio in (speech)", "Structured data (tables, logs)", "Code"])
158
  outputs = gr.CheckboxGroup(label="What output do you need?", choices=["Natural language answer / summary", "Classification / tagging", "Field extraction from text/PDF", "Content generation (copy, emails)", "Scoring / ranking / decision"])
159
  domains = gr.CheckboxGroup(label="Your Industry / Domain", choices=["General / consumer", "Ecommerce / SaaS", "Finance", "Healthcare", "Legal", "Internal enterprise knowledge"])
160
-
161
  with gr.Column(scale=1):
162
  gr.Markdown("### βš™οΈ Step 2: Set Your Constraints")
163
  data_sensitivity = gr.Radio(label="Data Privacy Requirements", choices=["Standard SaaS API is fine", "Must stay in a specific cloud region", "Strict: prefer on-prem / VPC only"], value="Standard SaaS API is fine")
@@ -167,13 +180,15 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue="orange", secondary_hue="slate")
167
  customization = gr.CheckboxGroup(label="Customization Needs", choices=["Prompt engineering only", "Style fine-tuning", "RAG + Tool Calling"])
168
 
169
  gr.Markdown("### 🎁 What you'll get:")
170
- gr.Markdown("- **Top 5 Live Models** from HF Hub matched to your task" + NL + "- **Optimized Deployment Path** (Cloud vs On-Prem)" + NL + "- **3-Week Implementation Roadmap**" + NL + "- **Tailored Cost & Latency Pro-Tips**")
 
 
 
171
 
172
  submit_btn = gr.Button("✨ Fetch Live Models and Generate My Strategy", variant="primary", size="lg")
173
  gr.Markdown("> πŸ• *Querying HuggingFace Hub live - may take 5-10 seconds. Please wait after clicking.*")
174
 
175
  gr.Markdown("---")
176
-
177
  output_md = gr.Markdown(label="Your Live AI Strategy")
178
 
179
  with gr.Column(visible=False) as lead_section:
@@ -187,28 +202,30 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue="orange", secondary_hue="slate")
187
  company = gr.Textbox(label="Company / Project", placeholder="AnkTechsol")
188
  infra = gr.Dropdown(label="Current Infra", choices=["AWS", "GCP", "Azure", "On-Prem", "Other/None"], value="AWS")
189
 
190
- lead_btn = gr.Button("πŸ“₯ Send Me My Architecture PDF", variant="primary")
191
  lead_status = gr.Markdown("")
192
-
193
- gr.Markdown("### βœ‰οΈ Ready to build?")
194
- gr.Markdown("Contact us at [**colab@anktechsol.com**](mailto:colab@anktechsol.com) to review these results with our architecture team and map your production roadmap.")
195
 
196
  submit_btn.click(
197
- fn=recommend_model,
198
- inputs=[modality, outputs, domains, data_sensitivity, volume, latency, context_size, customization],
199
  outputs=[output_md, lead_section]
200
  )
201
-
202
  lead_btn.click(
203
  fn=handle_lead,
204
  inputs=[name, email, company, infra],
205
- outputs=lead_status
206
  )
207
 
 
 
 
 
208
  gr.Markdown("---")
209
  gr.Markdown("### πŸ› οΈ Why Teams Trust AnkTechsol")
210
  gr.Markdown("We help startups and enterprises go from AI confusion to production-grade AI systems. Fine-tuning, RAG pipelines, GPU inferencing as a service - we deliver.")
211
  gr.Markdown("**[Visit anktechsol.com](https://anktechsol.com) | [LinkedIn](https://www.linkedin.com/company/anktechsol)**")
212
 
213
  if __name__ == "__main__":
214
- demo.launch()
 
1
  import gradio as gr
2
  import requests
3
  import os
4
+ import urllib.parse
5
 
6
  NL = chr(10)
7
 
 
58
  def format_model_table(models):
59
  if not models:
60
  return "No models found via HF API. Please try again."
 
61
  header = "| # | Model | Task | Downloads | Likes |" + NL
62
  header += "|---|-------|------|-----------|-------|" + NL
63
  rows = ""
 
82
  if t not in seen_t:
83
  seen_t.add(t)
84
  unique_tasks.append(t)
85
+
86
  if not unique_tasks:
87
  unique_tasks = ["text-generation"]
88
+
89
  license_filter = LICENSE_FILTER.get(data_sensitivity)
90
 
91
  # Fetch live models
 
127
 
128
  tasks_label = ", ".join(f"`{t}`" for t in unique_tasks)
129
  license_label = f"license: `{license_filter}`" if license_filter else "all licenses"
130
+
131
  summary = (
132
  "## πŸŽ‰ Your Live AI Model Strategy" + NL + NL +
133
  "### πŸ“¦ Top Models on HuggingFace Hub Right Now" + NL +
 
144
 
145
  def handle_lead(name, email, company, infra):
146
  if not email:
147
+ return gr.update(value="⚠️ Please provide an email."), gr.update(visible=False)
148
+
149
+ subject = urllib.parse.quote(f"Architecture Review Request: {company}")
150
+ body = urllib.parse.quote(
151
+ f"Hi AnkTechsol Team,{NL}{NL}"
152
+ f"I just used your AI Model Selection Wizard and would like a custom architecture PDF and cost estimate for my project.{NL}{NL}"
153
+ f"Name: {name}{NL}"
154
+ f"Company: {company}{NL}"
155
+ f"Current Infrastructure: {infra}{NL}{NL}"
156
+ f"Looking forward to hearing from you!"
157
+ )
158
+ mailto_url = f"mailto:colab@anktechsol.com?subject={subject}&body={body}"
159
+
160
+ msg = f"βœ… Thanks {name}! Click the button below to open your mail client and send your request to our architecture team."
161
+ return msg, gr.update(value=f"Open Mail Client to Send βœ‰οΈ", link=mailto_url, visible=True)
162
 
163
  with gr.Blocks(theme=gr.themes.Soft(primary_hue="orange", secondary_hue="slate"), title="AI Model Picker | AnkTechsol") as demo:
164
  gr.Markdown("# πŸš€ AI Model Selection Wizard")
 
170
  modality = gr.CheckboxGroup(label="What inputs are you working with?", choices=["Text in -> text out", "Images in (docs, UI, scans)", "Audio in (speech)", "Structured data (tables, logs)", "Code"])
171
  outputs = gr.CheckboxGroup(label="What output do you need?", choices=["Natural language answer / summary", "Classification / tagging", "Field extraction from text/PDF", "Content generation (copy, emails)", "Scoring / ranking / decision"])
172
  domains = gr.CheckboxGroup(label="Your Industry / Domain", choices=["General / consumer", "Ecommerce / SaaS", "Finance", "Healthcare", "Legal", "Internal enterprise knowledge"])
173
+
174
  with gr.Column(scale=1):
175
  gr.Markdown("### βš™οΈ Step 2: Set Your Constraints")
176
  data_sensitivity = gr.Radio(label="Data Privacy Requirements", choices=["Standard SaaS API is fine", "Must stay in a specific cloud region", "Strict: prefer on-prem / VPC only"], value="Standard SaaS API is fine")
 
180
  customization = gr.CheckboxGroup(label="Customization Needs", choices=["Prompt engineering only", "Style fine-tuning", "RAG + Tool Calling"])
181
 
182
  gr.Markdown("### 🎁 What you'll get:")
183
+ gr.Markdown("- **Top 5 Live Models** from HF Hub matched to your task" + NL +
184
+ "- **Optimized Deployment Path** (Cloud vs On-Prem)" + NL +
185
+ "- **3-Week Implementation Roadmap**" + NL +
186
+ "- **Tailored Cost & Latency Pro-Tips**")
187
 
188
  submit_btn = gr.Button("✨ Fetch Live Models and Generate My Strategy", variant="primary", size="lg")
189
  gr.Markdown("> πŸ• *Querying HuggingFace Hub live - may take 5-10 seconds. Please wait after clicking.*")
190
 
191
  gr.Markdown("---")
 
192
  output_md = gr.Markdown(label="Your Live AI Strategy")
193
 
194
  with gr.Column(visible=False) as lead_section:
 
202
  company = gr.Textbox(label="Company / Project", placeholder="AnkTechsol")
203
  infra = gr.Dropdown(label="Current Infra", choices=["AWS", "GCP", "Azure", "On-Prem", "Other/None"], value="AWS")
204
 
205
+ lead_btn = gr.Button("πŸ“₯ Generate My Architecture Request", variant="primary")
206
  lead_status = gr.Markdown("")
207
+ mail_btn = gr.Button("Open Mail Client βœ‰οΈ", visible=False, variant="secondary")
 
 
208
 
209
  submit_btn.click(
210
+ fn=recommend_model,
211
+ inputs=[modality, outputs, domains, data_sensitivity, volume, latency, context_size, customization],
212
  outputs=[output_md, lead_section]
213
  )
214
+
215
  lead_btn.click(
216
  fn=handle_lead,
217
  inputs=[name, email, company, infra],
218
+ outputs=[lead_status, mail_btn]
219
  )
220
 
221
+ gr.Markdown("---")
222
+ gr.Markdown("### βœ‰οΈ Ready to build?")
223
+ gr.Markdown("Contact us at [**colab@anktechsol.com**](mailto:colab@anktechsol.com) to review these results with our architecture team and map your production roadmap.")
224
+
225
  gr.Markdown("---")
226
  gr.Markdown("### πŸ› οΈ Why Teams Trust AnkTechsol")
227
  gr.Markdown("We help startups and enterprises go from AI confusion to production-grade AI systems. Fine-tuning, RAG pipelines, GPU inferencing as a service - we deliver.")
228
  gr.Markdown("**[Visit anktechsol.com](https://anktechsol.com) | [LinkedIn](https://www.linkedin.com/company/anktechsol)**")
229
 
230
  if __name__ == "__main__":
231
+ demo.launch()