Spaces:
Sleeping
Sleeping
Lovish Singla
commited on
Add files via upload
Browse files
app.py
CHANGED
|
@@ -50,7 +50,11 @@ Please refine the current summary to include the new information while maintaini
|
|
| 50 |
refinement_prompt = PromptTemplate(template=refinement_prompt_template, input_variables=["existing_answer", "text"])
|
| 51 |
|
| 52 |
# Initialize LLM with Groq API Key
|
| 53 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 54 |
|
| 55 |
# Button to Summarize Content
|
| 56 |
if st.button("Summarize the Content"):
|
|
|
|
| 50 |
refinement_prompt = PromptTemplate(template=refinement_prompt_template, input_variables=["existing_answer", "text"])
|
| 51 |
|
| 52 |
# Initialize LLM with Groq API Key
|
| 53 |
+
if groq_api_key:
|
| 54 |
+
try:
|
| 55 |
+
llm = ChatGroq(model="gemma2-9b-it", groq_api_key=groq_api_key)
|
| 56 |
+
except Exception as e:
|
| 57 |
+
st.error(f"Failed to initialize Groq client: {e}")
|
| 58 |
|
| 59 |
# Button to Summarize Content
|
| 60 |
if st.button("Summarize the Content"):
|