Instructions to use sadafwalliyani/D_Nikud_model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use sadafwalliyani/D_Nikud_model with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="sadafwalliyani/D_Nikud_model")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModel tokenizer = AutoTokenizer.from_pretrained("sadafwalliyani/D_Nikud_model") model = AutoModel.from_pretrained("sadafwalliyani/D_Nikud_model", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use sadafwalliyani/D_Nikud_model with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "sadafwalliyani/D_Nikud_model" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sadafwalliyani/D_Nikud_model", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/sadafwalliyani/D_Nikud_model
- SGLang
How to use sadafwalliyani/D_Nikud_model with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "sadafwalliyani/D_Nikud_model" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sadafwalliyani/D_Nikud_model", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "sadafwalliyani/D_Nikud_model" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "sadafwalliyani/D_Nikud_model", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use sadafwalliyani/D_Nikud_model with Docker Model Runner:
docker model run hf.co/sadafwalliyani/D_Nikud_model
Download src/plot_helpers.py from sadafwalliyani/D_Nikud_model: direct link, hf CLI and curl.
- Browser
- Download file 1.77 kB
-
https://huggingface.co/sadafwalliyani/D_Nikud_model/resolve/main/src/plot_helpers.py
- Command line
-
hf download hf://sadafwalliyani/D_Nikud_model/src/plot_helpers.py
-
curl -L -o plot_helpers.py https://huggingface.co/sadafwalliyani/D_Nikud_model/resolve/main/src/plot_helpers.py
1.77 kB
| # general | |
| import os | |
| # visual | |
| import matplotlib.pyplot as plt | |
| cols = ["precision", "recall", "f1-score", "support"] | |
| def generate_plot_by_nikud_dagesh_sin_dict(nikud_dagesh_sin_dict, title, y_axis, plot_folder=None): | |
| # Create a figure and axis | |
| plt.figure(figsize=(8, 6)) | |
| plt.title(title) | |
| ax = plt.gca() | |
| indexes = list(range(1, len(nikud_dagesh_sin_dict["nikud"]) + 1)) | |
| # Plot data series with different colors and labels | |
| ax.plot(indexes, nikud_dagesh_sin_dict["nikud"], color='blue', label='Nikud') | |
| ax.plot(indexes, nikud_dagesh_sin_dict["dagesh"], color='green', label='Dagesh') | |
| ax.plot(indexes, nikud_dagesh_sin_dict["sin"], color='red', label='Sin') | |
| # Add legend | |
| ax.legend() | |
| # Set labels and title | |
| ax.set_xlabel('Epoch') | |
| ax.set_ylabel(y_axis) | |
| if plot_folder is None: | |
| plt.show() | |
| else: | |
| plt.savefig(os.path.join(plot_folder, f'{title.replace(" ", "_")}_plot.jpg')) | |
| def generate_word_and_letter_accuracy_plot(word_and_letter_accuracy_dict, title, plot_folder=None): | |
| # Create a figure and axis | |
| plt.figure(figsize=(8, 6)) | |
| plt.title(title) | |
| ax = plt.gca() | |
| indexes = list(range(1, len(word_and_letter_accuracy_dict["all_nikud_letter"]) + 1)) | |
| # Plot data series with different colors and labels | |
| ax.plot(indexes, word_and_letter_accuracy_dict["all_nikud_letter"], color='blue', label='Letter') | |
| ax.plot(indexes, word_and_letter_accuracy_dict["all_nikud_word"], color='green', label='Word') | |
| # Add legend | |
| ax.legend() | |
| # Set labels and title | |
| ax.set_xlabel("Epoch") | |
| ax.set_ylabel("Accuracy") | |
| if plot_folder is None: | |
| plt.show() | |
| else: | |
| plt.savefig(os.path.join(plot_folder, 'word_and_letter_accuracy_plot.jpg')) | |