Spaces:
Sleeping
Sleeping
Update src/components/summaryEngine.py
Browse files
src/components/summaryEngine.py
CHANGED
|
@@ -21,15 +21,15 @@ class SummaryEngine:
|
|
| 21 |
logger.info("Summarizing the details extracted from the images")
|
| 22 |
allSummaries = "\n".join(texts)
|
| 23 |
completion = litellm.completion(
|
| 24 |
-
model = self.config
|
| 25 |
api_key = os.environ["GROQ_API_KEY"],
|
| 26 |
api_base = self.config["GROQ CONFIG"]["BASEURL"],
|
| 27 |
messages = [
|
| 28 |
{"role": "system", "content": self.prompts["summaryEnginePrompt"]},
|
| 29 |
{"role": "user", "content": f"AGGEREGATED SUMMARIES: {allSummaries}"}
|
| 30 |
],
|
| 31 |
-
max_tokens = self.config
|
| 32 |
-
temperature = self.config
|
| 33 |
)
|
| 34 |
response = completion["choices"][0]["message"]["content"]
|
| 35 |
logger.info("Summary generated successfully")
|
|
|
|
| 21 |
logger.info("Summarizing the details extracted from the images")
|
| 22 |
allSummaries = "\n".join(texts)
|
| 23 |
completion = litellm.completion(
|
| 24 |
+
model = self.config.get("SUMMARIZER", "LLM"),
|
| 25 |
api_key = os.environ["GROQ_API_KEY"],
|
| 26 |
api_base = self.config["GROQ CONFIG"]["BASEURL"],
|
| 27 |
messages = [
|
| 28 |
{"role": "system", "content": self.prompts["summaryEnginePrompt"]},
|
| 29 |
{"role": "user", "content": f"AGGEREGATED SUMMARIES: {allSummaries}"}
|
| 30 |
],
|
| 31 |
+
max_tokens = self.config.getint("SUMMARIZER", "MAXTOKENS"),
|
| 32 |
+
temperature = self.config.getfloat("SUMMARIZER", "TEMPERATURE")
|
| 33 |
)
|
| 34 |
response = completion["choices"][0]["message"]["content"]
|
| 35 |
logger.info("Summary generated successfully")
|