Spaces:
Runtime error
Runtime error
Download scripts/summarizer.py from MaryamKarimi080/SCR_Course_ChatBot: direct link, hf CLI and curl.
- Browser
- Download file 272 Bytes
-
https://huggingface.co/spaces/MaryamKarimi080/SCR_Course_ChatBot/resolve/4e3dac959605e93ccd7ca91c0d320f8d3fc0778c/scripts/summarizer.py
- Command line
-
hf download hf://spaces/MaryamKarimi080/SCR_Course_ChatBot@4e3dac959605e93ccd7ca91c0d320f8d3fc0778c/scripts/summarizer.py
-
curl -L -o summarizer.py https://huggingface.co/spaces/MaryamKarimi080/SCR_Course_ChatBot/resolve/4e3dac959605e93ccd7ca91c0d320f8d3fc0778c/scripts/summarizer.py
272 Bytes
| from langchain.chains.summarize import load_summarize_chain | |
| from langchain_openai import ChatOpenAI | |
| def get_summarizer(): | |
| llm = ChatOpenAI(model_name="gpt-4o-mini", temperature=0) | |
| chain = load_summarize_chain(llm, chain_type="map_reduce") | |
| return chain | |