Update app.py
Browse files
app.py
CHANGED
@@ -56,11 +56,15 @@ def build_pdf_index():
|
|
56 |
groq_api_key = "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"
|
57 |
client = Groq(api_key=groq_api_key)
|
58 |
|
59 |
-
class GroqLLM(
|
60 |
def __init__(self, api_key, model_name):
|
61 |
-
super().__init__(
|
|
|
|
|
|
|
|
|
62 |
|
63 |
-
# مدل
|
64 |
llm = GroqLLM(api_key=groq_api_key, model_name="deepseek-r1-distill-llama-70b")
|
65 |
|
66 |
from langchain_core.retrievers import BaseRetriever
|
|
|
56 |
groq_api_key = "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"
|
57 |
client = Groq(api_key=groq_api_key)
|
58 |
|
59 |
+
class GroqLLM(ChatOpenAI):
|
60 |
def __init__(self, api_key, model_name):
|
61 |
+
super().__init__(
|
62 |
+
openai_api_key=api_key,
|
63 |
+
model_name=model_name,
|
64 |
+
base_url="https://api.groq.com" # فقط همین
|
65 |
+
)
|
66 |
|
67 |
+
# ساخت مدل
|
68 |
llm = GroqLLM(api_key=groq_api_key, model_name="deepseek-r1-distill-llama-70b")
|
69 |
|
70 |
from langchain_core.retrievers import BaseRetriever
|