disLodge commited on
Commit
f84ae09
·
verified ·
1 Parent(s): af86f74

Removed before RAG for limit exceed error

Browse files
Files changed (1) hide show
  1. app.py +1 -8
app.py CHANGED
@@ -83,11 +83,6 @@ llm = ChatOpenAI(
83
  top_p=0.95
84
  )
85
 
86
- # Before RAG chain
87
- before_rag_template = "What is {topic}"
88
- before_rag_prompt = ChatPromptTemplate.from_template(before_rag_template)
89
- before_rag_chain = before_rag_prompt | llm | StrOutputParser()
90
-
91
  # After RAG chain
92
  after_rag_template = """You are a {role}. Summarize the following content for yourself and speak in terms of first person.
93
  Only include content relevant to that role like a resume summary.
@@ -118,13 +113,11 @@ def process_query(role, system_message, max_tokens, temperature, top_p):
118
  llm.temperature = temperature
119
  llm.top_p = top_p
120
 
121
- # Before RAG
122
- before_rag_result = before_rag_chain.invoke({"topic": "Hugging Face"})
123
 
124
  # After RAG
125
  after_rag_result = after_rag_chain.invoke({"role": role})
126
 
127
- return f"**Before RAG**\n{before_rag_result}\n\n**After RAG**\n{after_rag_result}"
128
 
129
 
130
  with gr.Blocks() as demo:
 
83
  top_p=0.95
84
  )
85
 
 
 
 
 
 
86
  # After RAG chain
87
  after_rag_template = """You are a {role}. Summarize the following content for yourself and speak in terms of first person.
88
  Only include content relevant to that role like a resume summary.
 
113
  llm.temperature = temperature
114
  llm.top_p = top_p
115
 
 
 
116
 
117
  # After RAG
118
  after_rag_result = after_rag_chain.invoke({"role": role})
119
 
120
+ return f"**RAG Summary**\n{after_rag_result}"
121
 
122
 
123
  with gr.Blocks() as demo: