Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -15,7 +15,7 @@ import streamlit as st
|
|
| 15 |
|
| 16 |
# Custom wrapper for Groq API
|
| 17 |
class GroqLLM(LLM):
|
| 18 |
-
api_key: str
|
| 19 |
model: str = "llama-3.3-70b-versatile"
|
| 20 |
|
| 21 |
@property
|
|
@@ -39,7 +39,7 @@ class GroqLLM(LLM):
|
|
| 39 |
data = response.json()
|
| 40 |
return data["choices"][0]["message"]["content"]
|
| 41 |
|
| 42 |
-
# Initialize Groq API LLM with
|
| 43 |
llm = GroqLLM(api_key="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")
|
| 44 |
|
| 45 |
# Function to extract content from a public Google Drive PDF link
|
|
@@ -114,4 +114,3 @@ if text:
|
|
| 114 |
st.write("Answer:", result)
|
| 115 |
else:
|
| 116 |
st.error("Failed to extract content from the document.")
|
| 117 |
-
|
|
|
|
| 15 |
|
| 16 |
# Custom wrapper for Groq API
|
| 17 |
class GroqLLM(LLM):
|
| 18 |
+
api_key: str = Field(..., description="API key for Groq")
|
| 19 |
model: str = "llama-3.3-70b-versatile"
|
| 20 |
|
| 21 |
@property
|
|
|
|
| 39 |
data = response.json()
|
| 40 |
return data["choices"][0]["message"]["content"]
|
| 41 |
|
| 42 |
+
# Initialize Groq API LLM with explicit API key
|
| 43 |
llm = GroqLLM(api_key="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")
|
| 44 |
|
| 45 |
# Function to extract content from a public Google Drive PDF link
|
|
|
|
| 114 |
st.write("Answer:", result)
|
| 115 |
else:
|
| 116 |
st.error("Failed to extract content from the document.")
|
|
|