Instructions to use nikraf/directionality_probe with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use nikraf/directionality_probe with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("feature-extraction", model="nikraf/directionality_probe", trust_remote_code=True)# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("nikraf/directionality_probe", trust_remote_code=True, device_map="auto") - Notebooks
- Google Colab
- Kaggle
| import os | |
| import requests | |
| def download_file(url, filepath, verbose=True): | |
| if verbose: | |
| print(f"Downloading {url} to {filepath}") | |
| response = requests.get(url) | |
| target_dir = os.path.dirname(filepath) | |
| if target_dir and not os.path.exists(target_dir): | |
| os.makedirs(target_dir) | |
| # Check if the request was successful | |
| if response.status_code == 200: | |
| with open(filepath, "wb") as file: | |
| file.write(response.content) | |
| else: | |
| print(f"Failed to download file. Status code: {response.status_code}") | |
| return filepath | |