Comments (9)
use this instead:
import sys
def stderr_decorator(func):
def wrapper(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
return wrapper
@stderr_decorator
def print_to_stderr(s):
return s
print_to_stderr("An error has occurred")
from llm-vm.
I’m totally a newb at modern python, what are the benefits of this approach? Also should the body function be func rather than print?
from llm-vm.
I guess I mean I’d love to understand the reasoning for this style!
from llm-vm.
I usually just use like mprint and then its less characters
from llm-vm.
I’m failing to google mprint. What do you mean?
from llm-vm.
I just mean name your helper print function which defaults to stderr mprint or smth
from llm-vm.
from llm-vm.
How about using the in-built logging module (https://realpython.com/python-logging/)?
from llm-vm.
interesting idea! maybe after we have a solid configuration subsystem.
from llm-vm.
Related Issues (20)
- LLM-VM does not support multiple GPUs currently HOT 4
- Refactor Openai API HOT 2
- ability to load a `.pt` file into the student model
- Add support to change dtype for a model? HOT 2
- llm-vm not running, though pip install method HOT 2
- Constrained generation error
- integer type error HOT 1
- Add new LLMs HOT 2
- OSError: [E050] Can't find model 'en_core_web_md'.
- README Llama2 Example Errors Requesting HuggingFace API Key HOT 1
- Pyenv error in Debain 12 HOT 2
- Many Warnings when Running tests.
- cannot install llm-vm HOT 4
- HuggingFace Token HOT 2
- Fix error handling and clean up client HOT 5
- LLM-VM Does Not Run HOT 1
- Downloading LLama2 and Other LLMs Running So Slow
- macOS: Installation error HOT 1
- ModuleNotFoundError: No module named 'outlines.text' HOT 3
- Revamp Github issue form HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from llm-vm.