Instructions to use cvnberk/solidity-generator with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use cvnberk/solidity-generator with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="cvnberk/solidity-generator")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("cvnberk/solidity-generator") model = AutoModelForCausalLM.from_pretrained("cvnberk/solidity-generator") - Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use cvnberk/solidity-generator with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "cvnberk/solidity-generator" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "cvnberk/solidity-generator", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/cvnberk/solidity-generator
- SGLang
How to use cvnberk/solidity-generator 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 "cvnberk/solidity-generator" \ --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": "cvnberk/solidity-generator", "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 "cvnberk/solidity-generator" \ --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": "cvnberk/solidity-generator", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use cvnberk/solidity-generator with Docker Model Runner:
docker model run hf.co/cvnberk/solidity-generator
Canberk commited on
Commit ·
80dae3e
1
Parent(s): c3ec6aa
Update README.md
Browse files
README.md
CHANGED
|
@@ -9,6 +9,9 @@ model-index:
|
|
| 9 |
datasets:
|
| 10 |
- mwritescode/slither-audited-smart-contracts
|
| 11 |
pipeline_tag: text-generation
|
|
|
|
|
|
|
|
|
|
| 12 |
---
|
| 13 |
|
| 14 |
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
|
@@ -102,4 +105,4 @@ sample_output = model.generate(input_ids, do_sample=True, max_length=400, num_re
|
|
| 102 |
|
| 103 |
# Decode and print the generated text
|
| 104 |
generated_text = tokenizer.decode(sample_output[0], skip_special_tokens=True)
|
| 105 |
-
print(generated_text)
|
|
|
|
| 9 |
datasets:
|
| 10 |
- mwritescode/slither-audited-smart-contracts
|
| 11 |
pipeline_tag: text-generation
|
| 12 |
+
language:
|
| 13 |
+
- en
|
| 14 |
+
library_name: transformers
|
| 15 |
---
|
| 16 |
|
| 17 |
<!-- This model card has been generated automatically according to the information the Trainer had access to. You
|
|
|
|
| 105 |
|
| 106 |
# Decode and print the generated text
|
| 107 |
generated_text = tokenizer.decode(sample_output[0], skip_special_tokens=True)
|
| 108 |
+
print(generated_text)
|