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 test.py from ericp/mynewmodel: direct link, hf CLI and curl.
- Browser
- Download file 510 Bytes
-
https://huggingface.co/ericp/mynewmodel/resolve/main/test.py
- Command line
-
hf download hf://ericp/mynewmodel/test.py
-
curl -L -o test.py https://huggingface.co/ericp/mynewmodel/resolve/main/test.py
510 Bytes
| from transformers import AutoModelForCausalLM, AutoTokenizer | |
| model_path = '/home/energyxadmin/UI2/merge' | |
| model = AutoModelForCausalLM.from_pretrained(model_path) | |
| tokenizer = AutoTokenizer.from_pretrained(model_path) | |
| # Example text generation | |
| input_ids = tokenizer.encode("What song did Eric Pask write or was a part of", return_tensors="pt") | |
| generated_text_samples = model.generate(input_ids, max_length=1000) | |
| print("Generated text:", tokenizer.decode(generated_text_samples[0], skip_special_tokens=True)) | |