donb-hf commited on
Commit
83e5635
β€’
1 Parent(s): 6630bd9

debug prompt

Browse files
Files changed (2) hide show
  1. app.py +6 -9
  2. 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=10,
110
- top_p=0.95,
111
- typical_p=0.95,
112
- temperature=0.01,
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 the future of intelligent information retrieval and augmented generation, inspired by the innovative spirit of San Francisco. Here’s why SF Sentinel is not just an app but a technological marvel:
4
 
5
  ---
6
 
7
- #### **Powered by State-of-the-Art Models**
8
 
9
- 1. **LLaMA 3: The Next Generation Language Model**
10
- - **NousResearch/Meta-Llama-3-8B-Instruct**: At the heart of SF Sentinel is the LLaMA 3, a powerful language model designed to understand and generate human-like text. With 8 billion parameters, this model brings unparalleled accuracy and fluency to natural language processing, ensuring that every response is as insightful as a conversation with a San Francisco sage.
11
 
12
- 2. **Arctic Embed: Precision Embeddings for Context-Aware Insights**
13
- - **Snowflake/snowflake-arctic-embed-m**: Our embedding model, Arctic Embed, excels at capturing the essence of complex texts. By transforming textual data into high-dimensional vectors, it allows SF Sentinel to understand the nuanced relationships between different pieces of information, delivering precise and context-aware insights every time.
14
 
15
  ---
16
 
17
- #### **Leveraging Hugging Face Inference Endpoints**
18
 
19
- - **Hugging Face Inference Endpoints**: The backbone of SF Sentinel's real-time processing capabilities, these endpoints enable seamless integration and deployment of cutting-edge models. By utilizing Hugging Face's robust infrastructure, we ensure that SF Sentinel can handle intensive computations with speed and reliability, providing instant responses to your queries.
20
 
21
  ---
22
 
23
- #### **Frameworks That Empower**
24
 
25
- 1. **LangChain: The Ultimate Chain of Intelligence**
26
- - **LangChain**: This powerful framework orchestrates the seamless interaction between different AI components. LangChain enables SF Sentinel to combine the strengths of LLaMA 3 and Arctic Embed, ensuring that data flows smoothly and insights are generated efficiently.
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
- Embrace the future. Experience **SF Sentinel**.
 
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! πŸŒ‰βœ¨