smitb2005 commited on
Commit
3ceb7bf
·
1 Parent(s): 3ad8d58
Files changed (4) hide show
  1. Dockerfile +35 -0
  2. comb.md +120 -0
  3. main.py +125 -0
  4. requirements.txt +121 -0
Dockerfile ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.11-alpine
2
+
3
+ ENV PYTHONDONTWRITEBYTECODE=1 \
4
+ PYTHONUNBUFFERED=1
5
+
6
+ WORKDIR /app
7
+
8
+ # install build deps required to compile wheels (tiktoken, psutil, etc.)
9
+ RUN apk add --no-cache --virtual .build-deps \
10
+ build-base \
11
+ git \
12
+ python3-dev \
13
+ openssl-dev \
14
+ libffi-dev \
15
+ linux-headers \
16
+ pkgconfig \
17
+ rust \
18
+ cargo
19
+
20
+ # upgrade pip/tools
21
+ RUN python -m pip install --upgrade pip setuptools wheel
22
+
23
+ # copy requirements and install
24
+ COPY requirements.txt /app/requirements.txt
25
+ RUN pip install --no-cache-dir -r /app/requirements.txt
26
+
27
+ # remove build deps to slim image
28
+ RUN apk del .build-deps
29
+
30
+ # copy app and rag file
31
+ COPY . /app
32
+
33
+ EXPOSE 7648
34
+
35
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7648"]
comb.md ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # NovaTra 1.0 – Event Details
2
+
3
+ ## 1. Event Overview
4
+ - **Event Name:** NovaTra 1.0
5
+ - **Organizer:** MLSC VCET (Microsoft Learn Student Chapter, Vidyavardhini’s College of Engineering and Technology)
6
+ - **Theme:** Business Innovation & Entrepreneurship
7
+ - **Event Type:** Hybrid (Online + Offline Rounds)
8
+ - **Audience:** All undergraduate students
9
+ - **Team Size:** 2–3 members (no solo participation allowed)
10
+ - **Purpose:**
11
+ - Provide a platform for students to pitch entrepreneurial/business ideas.
12
+ - Evaluate creativity, feasibility, problem-solving ability, and communication skills.
13
+ - Simulate real-world pitching with auctions, networking, and situational adaptability.
14
+
15
+ ---
16
+
17
+ ## 2. Selection Process – Online Rounds
18
+
19
+ ### Step 1: Registration + Video Submission (9th – 13th Sept 2025)
20
+ - Submit:
21
+ 1. Registration Form (team details, college name, member details).
22
+ 2. 1-minute Idea Video (compulsory).
23
+ - **Content:** Clear explanation of idea
24
+ - **Format:** MP4 or YouTube/Drive link
25
+ - **Duration:** Strictly 60 seconds
26
+
27
+ ### Step 2: Shortlisting (13th – 14th Sept 2025)
28
+ - Top 30 teams shortlisted.
29
+ - **Criteria:** Clarity, uniqueness, feasibility, presentation quality.
30
+
31
+ ### Step 3: Reel Round (15th Sept 2025)
32
+ - Shoot & post a **30–60s Instagram reel** showcasing product/idea.
33
+ - **Mandatory:**
34
+ - Tag MLSC VCET official Instagram
35
+ - Use hashtags: `#mlsc #novatra1.0`
36
+ - **Evaluation:** Clarity, creativity, technical quality, engagement.
37
+
38
+ ---
39
+
40
+ ## 3. On-the-Day Flow (17th Sept 2025 – Offline Rounds)
41
+
42
+ | Time | Activity |
43
+ |-----------------|-------------------------------------------|
44
+ | 8:30 AM | Arrival & ID Distribution |
45
+ | 9:00 – 9:45 AM | Opening Session & Inauguration |
46
+ | 9:45 – 11:30 AM | Round 1: Auction Round |
47
+ | 11:45 – 12:45 PM| Round 2: One-Minute Pitch + Jury Q&A |
48
+ | 1:00 – 1:30 PM | Mini Game 1: Networking Game |
49
+ | 1:45 PM | Elimination – Top 10 Teams Announced |
50
+ | 2:00 – 2:15 PM | Round 3 Briefing & Chit Distribution |
51
+ | 2:15 – 3:00 PM | Lunch Break + PPT Preparation |
52
+ | 3:00 – 5:00 PM | Round 3: Final Presentations + Jury Q&A |
53
+ | 5:00 – 5:45 PM | Mini Game 2: Quiz / Guest Talk |
54
+ | 5:45 – 6:15 PM | Results & Certificate Distribution |
55
+ | 6:15 – 6:30 PM | Closing Ceremony |
56
+
57
+ ---
58
+
59
+ ## 4. Detailed Round Info
60
+
61
+ ### Round 1 – Auction Round
62
+ - **Purpose:** Simulate bidding to gain competitive advantages. Tests decision-making & resource management.
63
+ - **Setup:**
64
+ - Each team gets virtual ₹10,000.
65
+ - Auctioneer announces advantages, teams bid.
66
+ - Highest bidder wins, credits reduced.
67
+ - **Advantages Examples:** +30s in Round 2, Skip Jury Q, Choose Order, Bonus Slide, Second Attempt, Wildcard Token.
68
+ - **Rules:** No overspending; tie-breaker = quick one-line pitch.
69
+ - **Notes:** No elimination in this round.
70
+
71
+ ### Round 2 – One-Minute Pitch
72
+ - **Purpose:** Test concise communication & confidence.
73
+ - **Setup:**
74
+ - 1-minute elevator pitch (speech only, no props).
75
+ - Teams may use purchased advantages.
76
+ - **Pitch Structure:**
77
+ 1. Hook (5–10s)
78
+ 2. Problem Statement (10–15s)
79
+ 3. Solution (20–25s)
80
+ 4. Impact & Market Fit (10–15s)
81
+ 5. Closing Line (5s)
82
+ - **Post Pitch:** Judges ask 1–2 Qs.
83
+ - **Evaluation (25%):** Clarity, uniqueness, feasibility, Q&A handling.
84
+ - **Notes:** Strictly time-bound; penalties for exceeding.
85
+
86
+ ### Mini Game 1 – Networking Game
87
+ - **Purpose:** Encourage peer interaction & marketing skills.
88
+ - **Setup:** Poster + tagline, networking fair style. Each team gets 5 star tokens.
89
+ - **Interaction Rules:** Pitch poster in 15–30s, peers award stars.
90
+ - **Winner:** Most stars = Networking Winner (+5 bonus points).
91
+ - **Notes:** Peer-based, judges not involved.
92
+
93
+ ### Round 3 – Final Presentation
94
+ - **Purpose:** Test depth, adaptability & market readiness.
95
+ - **Setup:**
96
+ - Top 10 teams.
97
+ - 5–7 min PPT.
98
+ - Chit-based situational challenge.
99
+ - **Example Challenges:**
100
+ - What if customers won’t pay?
101
+ - Competitor launches tomorrow?
102
+ - How to pivot if first market fails?
103
+ - **Structure:** Problem → Solution → Target Market → Business Model → Feasibility → Uniqueness → Chit Response → Conclusion.
104
+ - **Evaluation (65%):** Problem clarity, feasibility, market understanding, uniqueness, Q&A handling.
105
+ - **Notes:** Time cutoff = 7 mins; penalties if exceeded.
106
+
107
+ ### Mini Game 2 – Quiz / Guest Talk
108
+ - **Purpose:** Engagement + knowledge while scores are calculated.
109
+ - **Option 1 – Quiz:** Startup/innovation trivia (MCQs, T/F, rapid recall).
110
+ - **Option 2 – Guest Talk:** Keynote speaker, 20–30 mins.
111
+ - **Notes:** No effect on competition results.
112
+
113
+ ---
114
+
115
+ ## 5. Guidelines for Participants
116
+ - **Team Composition:** 2–3 members, same college only (no solo/cross-college).
117
+ - **Eligibility:** Open to all undergraduate students.
118
+ - **Fees:** ₹149 per shortlisted team.
119
+ - **Social Media:** Must follow MLSC VCET Instagram; all announcements posted there.
120
+ - **Conduct:** Maintain discipline, avoid plagiarism, respect judges (decisions final).
main.py ADDED
@@ -0,0 +1,125 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import os
2
+ import getpass
3
+ from groq import Groq
4
+ from langchain.chat_models import init_chat_model
5
+ from langchain_core.messages import HumanMessage, SystemMessage
6
+ from langchain_core.vectorstores import InMemoryVectorStore
7
+ from langchain_core.documents import Document
8
+ from langchain_text_splitters import RecursiveCharacterTextSplitter
9
+ from langchain_community.document_loaders import UnstructuredMarkdownLoader
10
+ from langchain_community.embeddings import HuggingFaceInferenceAPIEmbeddings
11
+ from langchain import hub
12
+ from langgraph.graph import START, StateGraph
13
+ from pydantic.main import BaseModel
14
+ from typing_extensions import List, TypedDict
15
+
16
+ from langchain_cohere import CohereEmbeddings
17
+
18
+ import re
19
+ from dotenv import load_dotenv
20
+ from fastapi import FastAPI
21
+ from fastapi.middleware.cors import CORSMiddleware
22
+ from fastapi.responses import JSONResponse
23
+ from fastapi.concurrency import run_in_threadpool
24
+
25
+ '''
26
+ if not os.environ.get("GROQ_API_KEY"):
27
+ os.environ["GROQ_API_KEY"] = getpass.getpass("Enter API key for Groq: ")
28
+ '''
29
+
30
+ load_dotenv()
31
+
32
+ # avoid printing secret values
33
+ print("GROQ_API_KEY set:", bool(os.getenv("GROQ_API_KEY")))
34
+ print("HUGGING_FACE_API_KEY set:", bool(os.getenv("HUGGING_FACE_API_KEY")))
35
+ print("COHERE_API_KEY set:", bool(os.getenv("COHERE_API_KEY") or os.getenv("COHERE")))
36
+
37
+
38
+ llm = init_chat_model("openai/gpt-oss-120b", model_provider="groq", api_key=os.getenv("GROQ_API_KEY"))
39
+ '''
40
+ embeddings = HuggingFaceInferenceAPIEmbeddings(
41
+ api_key = os.getenv('HUGGING_FACE_API_KEY'),
42
+ model_name="sentence-transformers/all-MiniLM-L6-v2"
43
+ )
44
+
45
+ embeddings = HuggingFaceInferenceAPIEmbeddings(
46
+ api_key=os.getenv('HUGGING_FACE_API_KEY'), model_name="sentence-transformers/all-MiniLM-L6-v2"
47
+ )'''
48
+
49
+ embeddings = CohereEmbeddings(
50
+ cohere_api_key=os.getenv("COHERE_API_KEY") or os.getenv("COHERE"),
51
+ model="embed-english-v3.0",
52
+ user_agent="langchain-cohere-embeddings"
53
+ )
54
+
55
+ vector_store = InMemoryVectorStore(embedding=embeddings)
56
+
57
+ md_loader = UnstructuredMarkdownLoader('comb.md')
58
+
59
+ text_splitter = RecursiveCharacterTextSplitter(chunk_size=500, chunk_overlap=100)
60
+ # all_splits = text_splitter.split_text(data_1 + "\n\n" + data_2 + "\n\n" + data_3 + "\n\n" + data_4)
61
+ # all_splits = text_splitter.split_text(comb)
62
+ all_splits = text_splitter.split_documents(md_loader.load())
63
+
64
+ # docs = [Document(page_content=text) for text in all_splits]
65
+ docs = [Document(page_content=text.page_content, metadata=text.metadata) for text in all_splits]
66
+ _ = vector_store.add_documents(documents=docs)
67
+
68
+
69
+ prompt = hub.pull("rlm/rag-prompt")
70
+
71
+ class State(TypedDict):
72
+ question: str
73
+ context: List[Document]
74
+ answer: str
75
+
76
+ def retrieve(state: State):
77
+ retrieved_docs = vector_store.similarity_search(state["question"])
78
+ return {"context": retrieved_docs}
79
+
80
+ def generate(state: State):
81
+ docs_content = "\n\n".join(doc.page_content for doc in state["context"])
82
+ messages = prompt.invoke({"question": state["question"], "context": docs_content})
83
+ response = llm.invoke(messages)
84
+ return {"answer": response.content}
85
+
86
+ graph_builder = StateGraph(State).add_sequence([retrieve, generate])
87
+ graph_builder.add_edge(START, "retrieve")
88
+ graph = graph_builder.compile()
89
+ '''
90
+ response = graph.invoke({"question": "Who should i contact for help ?"})
91
+ print(response["answer"])
92
+ '''
93
+
94
+ app = FastAPI()
95
+
96
+ origins = ["*"]
97
+
98
+ app.add_middleware(
99
+ CORSMiddleware,
100
+ allow_origins=origins,
101
+ allow_credentials=True,
102
+ allow_methods=["GET", "POST", "PUT", "DELETE"],
103
+ allow_headers=["*"],
104
+ )
105
+
106
+ @app.get("/ping")
107
+ async def ping():
108
+ return "Pong!"
109
+
110
+ class Query(BaseModel):
111
+ question: str
112
+
113
+ @app.post("/chat")
114
+ async def chat(request: Query):
115
+ # run the blocking graph.invoke without blocking the event loop
116
+ result = await run_in_threadpool(lambda: graph.invoke({"question": request.question}))
117
+ answer = result.get("answer", "")
118
+ answer = str(answer)
119
+ answer = re.sub(r'<think>.*?</think>', '', answer, flags=re.DOTALL)
120
+ return {"response": answer}
121
+
122
+ if __name__ == "__main__":
123
+ import uvicorn
124
+ print("Starting uvicorn server on http://127.0.0.1:8000")
125
+ uvicorn.run("main:app", host="127.0.0.1", port=8000, log_level="info")
requirements.txt ADDED
@@ -0,0 +1,121 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ aiofiles==24.1.0
2
+ aiohappyeyeballs==2.5.0
3
+ aiohttp==3.11.13
4
+ aiosignal==1.3.2
5
+ annotated-types==0.7.0
6
+ anyio==4.8.0
7
+ attrs==25.1.0
8
+ backoff==2.2.1
9
+ beautifulsoup4==4.13.3
10
+ certifi==2025.1.31
11
+ cffi==1.17.1
12
+ chardet==5.2.0
13
+ charset-normalizer==3.4.1
14
+ click==8.1.8
15
+ cohere==5.14.0
16
+ cryptography==44.0.2
17
+ dataclasses-json==0.6.7
18
+ distro==1.9.0
19
+ dnspython==2.7.0
20
+ email_validator==2.2.0
21
+ emoji==2.14.1
22
+ eval_type_backport==0.2.2
23
+ fastapi==0.115.11
24
+ fastapi-cli==0.0.7
25
+ fastavro==1.10.0
26
+ filelock==3.18.0
27
+ filetype==1.2.0
28
+ frozenlist==1.5.0
29
+ fsspec==2025.3.0
30
+ greenlet==3.1.1
31
+ groq==0.18.0
32
+ h11==0.14.0
33
+ html5lib==1.1
34
+ httpcore==1.0.7
35
+ httptools==0.6.4
36
+ httpx==0.28.1
37
+ httpx-sse==0.4.0
38
+ huggingface-hub==0.29.3
39
+ idna==3.10
40
+ Jinja2==3.1.6
41
+ jiter==0.9.0
42
+ joblib==1.4.2
43
+ jsonpatch==1.33
44
+ jsonpointer==3.0.0
45
+ langchain==0.3.20
46
+ langchain-cohere==0.4.3
47
+ langchain-community==0.3.19
48
+ langchain-core==0.3.43
49
+ langchain-groq==0.2.5
50
+ langchain-openai==0.3.8
51
+ langchain-text-splitters==0.3.6
52
+ langdetect==1.0.9
53
+ langgraph==0.3.5
54
+ langgraph-checkpoint==2.0.18
55
+ langgraph-prebuilt==0.1.2
56
+ langgraph-sdk==0.1.55
57
+ langsmith==0.3.13
58
+ lxml==5.3.1
59
+ Markdown==3.7
60
+ markdown-it-py==3.0.0
61
+ MarkupSafe==3.0.2
62
+ marshmallow==3.26.1
63
+ mdurl==0.1.2
64
+ msgpack==1.1.0
65
+ multidict==6.1.0
66
+ mypy-extensions==1.0.0
67
+ nest-asyncio==1.6.0
68
+ nltk==3.9.1
69
+ numpy==1.26.4
70
+ olefile==0.47
71
+ openai==1.65.5
72
+ orjson==3.10.15
73
+ packaging==24.2
74
+ propcache==0.3.0
75
+ psutil==7.0.0
76
+ pycparser==2.22
77
+ pydantic==2.10.6
78
+ pydantic-settings==2.8.1
79
+ pydantic_core==2.27.2
80
+ Pygments==2.19.1
81
+ pypdf==5.3.1
82
+ python-dateutil==2.9.0.post0
83
+ python-dotenv==1.0.1
84
+ python-iso639==2025.2.18
85
+ python-magic==0.4.27
86
+ python-multipart==0.0.20
87
+ python-oxmsg==0.0.2
88
+ PyYAML==6.0.2
89
+ RapidFuzz==3.12.2
90
+ regex==2024.11.6
91
+ requests==2.32.3
92
+ requests-toolbelt==1.0.0
93
+ rich==13.9.4
94
+ rich-toolkit==0.13.2
95
+ shellingham==1.5.4
96
+ six==1.17.0
97
+ sniffio==1.3.1
98
+ soupsieve==2.6
99
+ SQLAlchemy==2.0.38
100
+ starlette==0.46.1
101
+ tenacity==9.0.0
102
+ tiktoken==0.9.0
103
+ tokenizers==0.21.1
104
+ tqdm==4.67.1
105
+ typer==0.15.2
106
+ types-PyYAML==6.0.12.20241230
107
+ types-requests==2.32.0.20250306
108
+ typing-inspect==0.9.0
109
+ typing-inspection==0.4.0
110
+ typing_extensions==4.12.2
111
+ unstructured==0.17.0
112
+ unstructured-client==0.31.1
113
+ urllib3==2.3.0
114
+ uvicorn==0.34.0
115
+ uvloop==0.21.0
116
+ watchfiles==1.0.4
117
+ webencodings==0.5.1
118
+ websockets==15.0.1
119
+ wrapt==1.17.2
120
+ yarl==1.18.3
121
+ zstandard==0.23.0