Instructions to use Gan1108/electraForCausalLM with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Gan1108/electraForCausalLM with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Gan1108/electraForCausalLM")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Gan1108/electraForCausalLM") model = AutoModelForCausalLM.from_pretrained("Gan1108/electraForCausalLM", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Gan1108/electraForCausalLM with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Gan1108/electraForCausalLM" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Gan1108/electraForCausalLM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Gan1108/electraForCausalLM
- SGLang
How to use Gan1108/electraForCausalLM 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 "Gan1108/electraForCausalLM" \ --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": "Gan1108/electraForCausalLM", "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 "Gan1108/electraForCausalLM" \ --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": "Gan1108/electraForCausalLM", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Gan1108/electraForCausalLM with Docker Model Runner:
docker model run hf.co/Gan1108/electraForCausalLM
|
Download README.md from Gan1108/electraForCausalLM: direct link, hf CLI and curl.
- Browser
- Download file 1.41 kB
-
https://huggingface.co/Gan1108/electraForCausalLM/resolve/main/README.md
- Command line
-
hf download hf://Gan1108/electraForCausalLM/README.md
-
curl -L -o README.md https://huggingface.co/Gan1108/electraForCausalLM/resolve/main/README.md
1.41 kB
| license: mit | |
| base_model: lang-uk/electra-base-ukrainian-cased-generator | |
| tags: | |
| - generated_from_trainer | |
| model-index: | |
| - name: electraForCausalLM | |
| results: [] | |
| language: | |
| - uk | |
| widget: | |
| - text: "0007347852 - 734785.0 - Підшипник кульковий закритий спеціальний " | |
| # electraForCausalLM | |
| This model is a fine-tuned version of [lang-uk/electra-base-ukrainian-cased-generator](https://huggingface.co/lang-uk/electra-base-ukrainian-cased-generator) on an unknown dataset. | |
| It achieves the following results on the evaluation set: | |
| - Loss: 1.3302 | |
| ## Model description | |
| The model is trained to generate a text description in Ukrainian of spare parts for agricultural machinery based on their name. | |
| ## Training procedure | |
| ### Training hyperparameters | |
| The following hyperparameters were used during training: | |
| - learning_rate: 2e-05 | |
| - train_batch_size: 8 | |
| - eval_batch_size: 8 | |
| - seed: 42 | |
| - optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-08 | |
| - lr_scheduler_type: linear | |
| - num_epochs: 3.0 | |
| ### Training results | |
| | Training Loss | Epoch | Step | Validation Loss | | |
| |:-------------:|:-----:|:----:|:---------------:| | |
| | 1.7321 | 1.0 | 2354 | 1.5172 | | |
| | 1.4763 | 2.0 | 4708 | 1.3670 | | |
| | 1.4006 | 3.0 | 7062 | 1.3302 | | |
| ### Framework versions | |
| - Transformers 4.38.2 | |
| - Pytorch 2.2.1+cu121 | |
| - Datasets 2.18.0 | |
| - Tokenizers 0.15.2 |