Update app.py
Browse files
app.py
CHANGED
@@ -4,6 +4,7 @@ import requests
|
|
4 |
from datetime import datetime, timedelta
|
5 |
import logging
|
6 |
import random
|
|
|
7 |
|
8 |
# =============================================================================
|
9 |
# Setup Logging
|
@@ -11,9 +12,16 @@ import random
|
|
11 |
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s')
|
12 |
|
13 |
# =============================================================================
|
14 |
-
#
|
15 |
# =============================================================================
|
|
|
|
|
|
|
|
|
16 |
|
|
|
|
|
|
|
17 |
def create_performance_comparison():
|
18 |
"""
|
19 |
Creates a performance comparison chart showing current (2GB VRAM) capabilities
|
@@ -206,7 +214,6 @@ def create_project_timeline():
|
|
206 |
# =============================================================================
|
207 |
# Helper Functions: Textual Content for Pitch Deck
|
208 |
# =============================================================================
|
209 |
-
|
210 |
def display_tech_stack():
|
211 |
"""
|
212 |
Returns a Markdown string detailing the technical stack and tools used.
|
@@ -372,9 +379,41 @@ def display_pitch_deck_overview():
|
|
372 |
return pitch_deck
|
373 |
|
374 |
# =============================================================================
|
375 |
-
#
|
376 |
# =============================================================================
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
377 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
378 |
# -----------------------------------------------------------------------------
|
379 |
# Construct the Gradio Interface with Multiple Tabs
|
380 |
# -----------------------------------------------------------------------------
|
@@ -511,7 +550,37 @@ with gr.Blocks(theme=gr.themes.Soft(), css="""
|
|
511 |
gr.Markdown(display_pitch_deck_overview())
|
512 |
|
513 |
# -------------------------------------------------------------------------
|
514 |
-
# Tab 5:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
515 |
# -------------------------------------------------------------------------
|
516 |
with gr.TabItem("π
Project Timeline & Milestones"):
|
517 |
gr.Markdown("""
|
@@ -529,7 +598,7 @@ with gr.Blocks(theme=gr.themes.Soft(), css="""
|
|
529 |
""")
|
530 |
|
531 |
# -------------------------------------------------------------------------
|
532 |
-
# Tab
|
533 |
# -------------------------------------------------------------------------
|
534 |
with gr.TabItem("π From the Heart"):
|
535 |
gr.Markdown(display_personal_note())
|
@@ -539,9 +608,9 @@ with gr.Blocks(theme=gr.themes.Soft(), css="""
|
|
539 |
- **LinkedIn:** <a href="https://www.linkedin.com/in/waynesletcher/" target="_blank" style="color: #2563EB;">Wayne Sletcher</a>
|
540 |
- **Website:** <a href="https://www.sletchersystems.com/" target="_blank" style="color: #2563EB;">sletchersystems.com</a>
|
541 |
""")
|
542 |
-
|
543 |
# -------------------------------------------------------------------------
|
544 |
-
# Tab
|
545 |
# -------------------------------------------------------------------------
|
546 |
with gr.TabItem("π₯οΈ SaaS Solutions & Revenue Model"):
|
547 |
gr.Markdown("""
|
@@ -583,8 +652,9 @@ with gr.Blocks(theme=gr.themes.Soft(), css="""
|
|
583 |
# - Company Purpose, Problem, Solution, Why Now, Market Size, Competition,
|
584 |
# Product, Business Model, Team, and Financials
|
585 |
# - An in-depth look at my technical stack and current projects
|
|
|
586 |
# - A project timeline and milestones for future growth
|
587 |
-
# - A heartfelt personal note aimed at making Dad proud
|
588 |
# - Persistent call-to-action with contact details (email, LinkedIn, website)
|
589 |
#
|
590 |
# Future enhancements may include:
|
@@ -739,10 +809,6 @@ with gr.Blocks(theme=gr.themes.Soft(), css="""
|
|
739 |
#
|
740 |
#
|
741 |
#
|
742 |
-
#
|
743 |
-
#
|
744 |
-
#
|
745 |
-
#
|
746 |
# =============================================================================
|
747 |
# End of File
|
748 |
# =============================================================================
|
|
|
4 |
from datetime import datetime, timedelta
|
5 |
import logging
|
6 |
import random
|
7 |
+
from transformers import pipeline
|
8 |
|
9 |
# =============================================================================
|
10 |
# Setup Logging
|
|
|
12 |
logging.basicConfig(level=logging.DEBUG, format='%(asctime)s - %(levelname)s - %(message)s')
|
13 |
|
14 |
# =============================================================================
|
15 |
+
# Load In-House Hugging Face Models for AI Agents
|
16 |
# =============================================================================
|
17 |
+
# Replace these model IDs with your actual in-house model names.
|
18 |
+
summarizer = pipeline("summarization", model="myorg/inhouse-summarizer")
|
19 |
+
research_generator = pipeline("text-generation", model="myorg/inhouse-research", max_length=100)
|
20 |
+
planner_generator = pipeline("text-generation", model="myorg/inhouse-planner", max_length=150)
|
21 |
|
22 |
+
# =============================================================================
|
23 |
+
# Helper Functions: Interactive Chart Generators
|
24 |
+
# =============================================================================
|
25 |
def create_performance_comparison():
|
26 |
"""
|
27 |
Creates a performance comparison chart showing current (2GB VRAM) capabilities
|
|
|
214 |
# =============================================================================
|
215 |
# Helper Functions: Textual Content for Pitch Deck
|
216 |
# =============================================================================
|
|
|
217 |
def display_tech_stack():
|
218 |
"""
|
219 |
Returns a Markdown string detailing the technical stack and tools used.
|
|
|
379 |
return pitch_deck
|
380 |
|
381 |
# =============================================================================
|
382 |
+
# New Agent Functions Using In-House Hugging Face Models
|
383 |
# =============================================================================
|
384 |
+
def report_agent(data):
|
385 |
+
"""
|
386 |
+
Generates a summary report using the in-house summarizer model.
|
387 |
+
"""
|
388 |
+
if not data or len(data.strip()) == 0:
|
389 |
+
return "Please provide input text for summarization."
|
390 |
+
summary = summarizer(data, max_length=130, min_length=30, do_sample=False)
|
391 |
+
logging.debug("Summary generated using in-house summarizer.")
|
392 |
+
return summary[0]['summary_text']
|
393 |
|
394 |
+
def planning_agent(goal):
|
395 |
+
"""
|
396 |
+
Generates a detailed action plan based on the provided goal using the in-house planner model.
|
397 |
+
"""
|
398 |
+
if not goal or len(goal.strip()) == 0:
|
399 |
+
return "Please provide a goal for planning."
|
400 |
+
plan = planner_generator(goal, max_length=150, num_return_sequences=1)
|
401 |
+
logging.debug("Plan generated using in-house planner.")
|
402 |
+
return plan[0]['generated_text']
|
403 |
+
|
404 |
+
def research_agent(query):
|
405 |
+
"""
|
406 |
+
Generates research insights based on the provided query using the in-house research generator.
|
407 |
+
"""
|
408 |
+
if not query or len(query.strip()) == 0:
|
409 |
+
return "Please provide a research query."
|
410 |
+
result = research_generator(query, max_length=100, num_return_sequences=1)
|
411 |
+
logging.debug("Research output generated using in-house research model.")
|
412 |
+
return result[0]['generated_text']
|
413 |
+
|
414 |
+
# =============================================================================
|
415 |
+
# End of Helper Functions
|
416 |
+
# =============================================================================
|
417 |
# -----------------------------------------------------------------------------
|
418 |
# Construct the Gradio Interface with Multiple Tabs
|
419 |
# -----------------------------------------------------------------------------
|
|
|
550 |
gr.Markdown(display_pitch_deck_overview())
|
551 |
|
552 |
# -------------------------------------------------------------------------
|
553 |
+
# Tab 5: π€ AI Agents
|
554 |
+
# -------------------------------------------------------------------------
|
555 |
+
with gr.TabItem("π€ AI Agents"):
|
556 |
+
gr.Markdown("""
|
557 |
+
### AI Agent Tools
|
558 |
+
Use these tools to generate summaries, action plans, and research insights
|
559 |
+
using our in-house Hugging Face models.
|
560 |
+
""")
|
561 |
+
with gr.Row():
|
562 |
+
with gr.Column():
|
563 |
+
gr.Markdown("#### Summarizer")
|
564 |
+
summarizer_input = gr.Textbox(label="Enter text to summarize", placeholder="Paste text here...", lines=5)
|
565 |
+
summarizer_output = gr.Textbox(label="Summary", lines=5)
|
566 |
+
summarizer_button = gr.Button("Generate Summary")
|
567 |
+
summarizer_button.click(report_agent, inputs=[summarizer_input], outputs=[summarizer_output])
|
568 |
+
with gr.Column():
|
569 |
+
gr.Markdown("#### Planner")
|
570 |
+
planner_input = gr.Textbox(label="Enter goal or task", placeholder="Describe your goal...", lines=5)
|
571 |
+
planner_output = gr.Textbox(label="Action Plan", lines=5)
|
572 |
+
planner_button = gr.Button("Generate Plan")
|
573 |
+
planner_button.click(planning_agent, inputs=[planner_input], outputs=[planner_output])
|
574 |
+
with gr.Row():
|
575 |
+
with gr.Column():
|
576 |
+
gr.Markdown("#### Research Agent")
|
577 |
+
research_input = gr.Textbox(label="Enter research query", placeholder="Ask your research question...", lines=5)
|
578 |
+
research_output = gr.Textbox(label="Research Insights", lines=5)
|
579 |
+
research_button = gr.Button("Generate Research")
|
580 |
+
research_button.click(research_agent, inputs=[research_input], outputs=[research_output])
|
581 |
+
|
582 |
+
# -------------------------------------------------------------------------
|
583 |
+
# Tab 6: Project Timeline & Milestones
|
584 |
# -------------------------------------------------------------------------
|
585 |
with gr.TabItem("π
Project Timeline & Milestones"):
|
586 |
gr.Markdown("""
|
|
|
598 |
""")
|
599 |
|
600 |
# -------------------------------------------------------------------------
|
601 |
+
# Tab 7: From the Heart & Contact
|
602 |
# -------------------------------------------------------------------------
|
603 |
with gr.TabItem("π From the Heart"):
|
604 |
gr.Markdown(display_personal_note())
|
|
|
608 |
- **LinkedIn:** <a href="https://www.linkedin.com/in/waynesletcher/" target="_blank" style="color: #2563EB;">Wayne Sletcher</a>
|
609 |
- **Website:** <a href="https://www.sletchersystems.com/" target="_blank" style="color: #2563EB;">sletchersystems.com</a>
|
610 |
""")
|
611 |
+
|
612 |
# -------------------------------------------------------------------------
|
613 |
+
# Tab 8: SaaS Solutions & Revenue Model
|
614 |
# -------------------------------------------------------------------------
|
615 |
with gr.TabItem("π₯οΈ SaaS Solutions & Revenue Model"):
|
616 |
gr.Markdown("""
|
|
|
652 |
# - Company Purpose, Problem, Solution, Why Now, Market Size, Competition,
|
653 |
# Product, Business Model, Team, and Financials
|
654 |
# - An in-depth look at my technical stack and current projects
|
655 |
+
# - A new tab ("π€ AI Agents") for in-house NLP tasks: summarization, planning, research
|
656 |
# - A project timeline and milestones for future growth
|
657 |
+
# - A heartfelt personal note aimed at making Dad proud, along with contact details
|
658 |
# - Persistent call-to-action with contact details (email, LinkedIn, website)
|
659 |
#
|
660 |
# Future enhancements may include:
|
|
|
809 |
#
|
810 |
#
|
811 |
#
|
|
|
|
|
|
|
|
|
812 |
# =============================================================================
|
813 |
# End of File
|
814 |
# =============================================================================
|