debug prompt
Browse files- app.py +6 -9
- chainlit.md +14 -19
app.py
CHANGED
@@ -106,14 +106,14 @@ rag_prompt = PromptTemplate.from_template(RAG_PROMPT_TEMPLATE)
|
|
106 |
hf_llm = HuggingFaceEndpoint(
|
107 |
endpoint_url=HF_LLM_ENDPOINT,
|
108 |
max_new_tokens=512,
|
109 |
-
top_k=
|
110 |
-
top_p=0.
|
111 |
-
|
112 |
-
|
113 |
-
repetition_penalty=1.03,
|
114 |
huggingfacehub_api_token=HF_TOKEN,
|
115 |
)
|
116 |
|
|
|
117 |
@cl.author_rename
|
118 |
def rename(original_author: str):
|
119 |
"""
|
@@ -137,10 +137,7 @@ async def start_chat():
|
|
137 |
"""
|
138 |
|
139 |
### BUILD LCEL RAG CHAIN THAT ONLY RETURNS TEXT
|
140 |
-
lcel_rag_chain = (
|
141 |
-
{"context": itemgetter("query") | hf_retriever, "query": itemgetter("query")}
|
142 |
-
| rag_prompt | hf_llm
|
143 |
-
)
|
144 |
|
145 |
cl.user_session.set("lcel_rag_chain", lcel_rag_chain)
|
146 |
|
|
|
106 |
hf_llm = HuggingFaceEndpoint(
|
107 |
endpoint_url=HF_LLM_ENDPOINT,
|
108 |
max_new_tokens=512,
|
109 |
+
top_k=50, # Increase to allow more diverse sampling
|
110 |
+
top_p=0.9, # Slightly decrease to balance diversity and coherence
|
111 |
+
temperature=0.8, # Increase to add creativity and friendliness
|
112 |
+
repetition_penalty=1.01, # Slightly lower to reduce repetition
|
|
|
113 |
huggingfacehub_api_token=HF_TOKEN,
|
114 |
)
|
115 |
|
116 |
+
|
117 |
@cl.author_rename
|
118 |
def rename(original_author: str):
|
119 |
"""
|
|
|
137 |
"""
|
138 |
|
139 |
### BUILD LCEL RAG CHAIN THAT ONLY RETURNS TEXT
|
140 |
+
lcel_rag_chain = {"context": itemgetter("query") | hf_retriever, "query": itemgetter("query")}| rag_prompt | hf_llm
|
|
|
|
|
|
|
141 |
|
142 |
cl.user_session.set("lcel_rag_chain", lcel_rag_chain)
|
143 |
|
chainlit.md
CHANGED
@@ -1,36 +1,31 @@
|
|
1 |
-
### SF Sentinel: The Cutting-Edge AI Experience
|
2 |
|
3 |
-
Welcome to **SF Sentinel**, your gateway to
|
4 |
|
5 |
---
|
6 |
|
7 |
-
#### **Powered by State-of-the-Art Models**
|
8 |
|
9 |
-
1. **LLaMA 3:
|
10 |
-
- **NousResearch/Meta-Llama-3-8B-Instruct**:
|
11 |
|
12 |
-
2. **Arctic Embed: Precision Embeddings
|
13 |
-
- **Snowflake/snowflake-arctic-embed-m**:
|
14 |
|
15 |
---
|
16 |
|
17 |
-
#### **Leveraging Hugging Face Inference Endpoints**
|
18 |
|
19 |
-
- **
|
20 |
|
21 |
---
|
22 |
|
23 |
-
#### **Frameworks That Empower**
|
24 |
|
25 |
-
1. **LangChain
|
26 |
-
|
27 |
-
|
28 |
-
2. **FAISS: High-Speed Similarity Search**
|
29 |
-
- **Facebook AI Similarity Search (FAISS)**: A critical component for managing and querying large-scale vector data, FAISS ensures that SF Sentinel can perform rapid and accurate similarity searches. This means you get the most relevant information faster than ever before.
|
30 |
-
|
31 |
-
3. **Chainlit: Interactive AI Conversations**
|
32 |
-
- **Chainlit**: Our conversational framework, Chainlit, transforms SF Sentinel into an interactive assistant. With Chainlit, you can engage in dynamic, back-and-forth conversations, making the experience not just informative but also engaging and intuitive.
|
33 |
|
34 |
---
|
35 |
|
36 |
-
|
|
|
1 |
+
### π SF Sentinel: The Cutting-Edge AI Experience π
|
2 |
|
3 |
+
Welcome to **SF Sentinel**, your gateway to intelligent info retrieval inspired by San Francisco. Here's why SF Sentinel is a technological marvel:
|
4 |
|
5 |
---
|
6 |
|
7 |
+
#### π **Powered by State-of-the-Art Models**
|
8 |
|
9 |
+
1. **LLaMA 3: Next Gen Language Model**
|
10 |
+
- **NousResearch/Meta-Llama-3-8B-Instruct**: 8 billion parameters for unparalleled accuracy and fluency in natural language processing.
|
11 |
|
12 |
+
2. **Arctic Embed: Precision Embeddings**
|
13 |
+
- **Snowflake/snowflake-arctic-embed-m**: Captures the essence of complex texts for context-aware insights.
|
14 |
|
15 |
---
|
16 |
|
17 |
+
#### β‘ **Leveraging Hugging Face Inference Endpoints**
|
18 |
|
19 |
+
- **Real-Time Processing**: Instant responses with Hugging Face's robust infrastructure for seamless model integration.
|
20 |
|
21 |
---
|
22 |
|
23 |
+
#### π§ **Frameworks That Empower**
|
24 |
|
25 |
+
1. **LangChain**: Orchestrates AI components for efficient data flow and insight generation.
|
26 |
+
2. **FAISS**: High-speed similarity search for rapid and accurate info retrieval.
|
27 |
+
3. **Chainlit**: Interactive AI conversations for engaging and intuitive user experiences.
|
|
|
|
|
|
|
|
|
|
|
28 |
|
29 |
---
|
30 |
|
31 |
+
Experience the future. Discover **SF Sentinel** today! πβ¨
|