Instructions to use Mrigendra100/XpathGenerator with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Mrigendra100/XpathGenerator with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="Mrigendra100/XpathGenerator")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("Mrigendra100/XpathGenerator") model = AutoModelForCausalLM.from_pretrained("Mrigendra100/XpathGenerator", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Mrigendra100/XpathGenerator with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Mrigendra100/XpathGenerator" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Mrigendra100/XpathGenerator", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/Mrigendra100/XpathGenerator
- SGLang
How to use Mrigendra100/XpathGenerator 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 "Mrigendra100/XpathGenerator" \ --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": "Mrigendra100/XpathGenerator", "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 "Mrigendra100/XpathGenerator" \ --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": "Mrigendra100/XpathGenerator", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use Mrigendra100/XpathGenerator with Docker Model Runner:
docker model run hf.co/Mrigendra100/XpathGenerator
|
Download README.md from Mrigendra100/XpathGenerator: direct link, hf CLI and curl.
- Browser
- Download file 1.07 kB
-
https://huggingface.co/Mrigendra100/XpathGenerator/resolve/main/README.md
- Command line
-
hf download hf://Mrigendra100/XpathGenerator/README.md
-
curl -L -H "Authorization: Bearer $HF_TOKEN" -o README.md https://huggingface.co/Mrigendra100/XpathGenerator/resolve/main/README.md
1.07 kB
| language: | |
| - en | |
| base_model: EleutherAI/gpt-neo-1.3B | |
| pipeline_tag: text-generation | |
| library_name: transformers | |
| # Model Card for Mrigendra100/XpathGenerator | |
| ## Model Details | |
| - **Model Name**: Mrigendra100/XpathGenerator | |
| - **Base Model**: EleutherAI/gpt-neo-1.3B | |
| - **Task**: Text generation (specifically for generating XPath expressions from HTML) | |
| ## Library | |
| - **Transformers**: This model uses the Hugging Face `transformers` library for handling pre-trained models and performing inference. | |
| ## Usage | |
| To use this model, you can leverage the `transformers` library from Hugging Face. Below is an example of how to load and use the model for inference: | |
| ```python | |
| from transformers import pipeline | |
| # Load the model and tokenizer | |
| generator = pipeline("text-generation", model="Mrigendra100/XpathGenerator") | |
| # Generate XPath from input HTML | |
| input_html = '<button class="btn relative btn-primary shrink-0"><div class="flex justify-center">Get Plus</div></button>' | |
| generated_xpath = generator(input_html, max_length=50) | |
| print("Generated XPath:", generated_xpath) |