Mbonea commited on
Commit
338b8f2
·
1 Parent(s): 7df9f15
Files changed (1) hide show
  1. App/Chat/utils/Summarize.py +4 -1
App/Chat/utils/Summarize.py CHANGED
@@ -16,7 +16,7 @@ PALM_API = ""
16
  API_KEY = os.environ.get("PALM_API", PALM_API)
17
  palm.configure(api_key=API_KEY)
18
 
19
- GroqAPIKey = os.environ.get("Groq_API", "")
20
  text_splitter = RecursiveCharacterTextSplitter(
21
  separators=["\n\n", "\n", "."],
22
  chunk_size=1500,
@@ -104,6 +104,7 @@ async def PalmTextModel(text, candidates=1):
104
  # ]
105
  # return temp
106
  temp = result["choices"][0]["message"]["content"]
 
107
  return temp
108
  else:
109
  print(f"Error: {response.status}\n{await response.text()}")
@@ -141,3 +142,5 @@ async def Summarizer(essay):
141
  main = " ".join(responses)
142
  ans = await PalmTextModel(combine_prompt.format(text=main))
143
  return ans
 
 
 
16
  API_KEY = os.environ.get("PALM_API", PALM_API)
17
  palm.configure(api_key=API_KEY)
18
 
19
+ GroqAPIKey = os.environ.get("Groq_API", "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")
20
  text_splitter = RecursiveCharacterTextSplitter(
21
  separators=["\n\n", "\n", "."],
22
  chunk_size=1500,
 
104
  # ]
105
  # return temp
106
  temp = result["choices"][0]["message"]["content"]
107
+ print('hello ')
108
  return temp
109
  else:
110
  print(f"Error: {response.status}\n{await response.text()}")
 
142
  main = " ".join(responses)
143
  ans = await PalmTextModel(combine_prompt.format(text=main))
144
  return ans
145
+
146
+ asyncio.run(Summarizer("This is a test of the summarizer"))