Spaces:
Runtime error
Runtime error
Download utils/summarizer.py from NexusInstruments/omniscientframework: direct link, hf CLI and curl.
- Browser
- Download file 336 Bytes
-
https://huggingface.co/spaces/NexusInstruments/omniscientframework/resolve/main/utils/summarizer.py
- Command line
-
hf download hf://spaces/NexusInstruments/omniscientframework/utils/summarizer.py
-
curl -L -o summarizer.py https://huggingface.co/spaces/NexusInstruments/omniscientframework/resolve/main/utils/summarizer.py
336 Bytes
| from backend import run_llm | |
| def summarize_text(text: str, max_len: int = 500) -> str: | |
| """Summarize a block of text/logs with LLM backend""" | |
| if not text.strip(): | |
| return "⚠️ No content to summarize." | |
| prompt = f"Summarize the following text in plain English:\n\n{text[:2000]}" | |
| return run_llm(prompt)[:max_len] | |