Instructions to use ericp/mynewmodel with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use ericp/mynewmodel with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("meta-llama/Llama-2-7b-chat-hf") model = PeftModel.from_pretrained(base_model, "ericp/mynewmodel") - Notebooks
- Google Colab
- Kaggle
Download utils.py from ericp/mynewmodel: direct link, hf CLI and curl.
- Browser
- Download file 480 Bytes
-
https://huggingface.co/ericp/mynewmodel/resolve/main/utils.py
- Command line
-
hf download hf://ericp/mynewmodel/utils.py
-
curl -L -o utils.py https://huggingface.co/ericp/mynewmodel/resolve/main/utils.py
480 Bytes
| import logging | |
| from typing_extensions import Literal | |
| from rich.logging import RichHandler | |
| def get_logger(name: str, level: Literal["info", "warning", "debug"]) -> logging.Logger: | |
| rich_handler = RichHandler(level=logging.INFO, rich_tracebacks=True, markup=True) | |
| logger = logging.getLogger(name) | |
| logger.setLevel(logging._nameToLevel[level.upper()]) | |
| if not logger.handlers: | |
| logger.addHandler(rich_handler) | |
| logger.propagate = False | |
| return logger | |