Instructions to use liyuesen/druggpt with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use liyuesen/druggpt with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="liyuesen/druggpt")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("liyuesen/druggpt") model = AutoModelForCausalLM.from_pretrained("liyuesen/druggpt") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use liyuesen/druggpt with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "liyuesen/druggpt" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "liyuesen/druggpt", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/liyuesen/druggpt
- SGLang
How to use liyuesen/druggpt 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 "liyuesen/druggpt" \ --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": "liyuesen/druggpt", "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 "liyuesen/druggpt" \ --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": "liyuesen/druggpt", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use liyuesen/druggpt with Docker Model Runner:
docker model run hf.co/liyuesen/druggpt
Update drug_generator.py
Browse files- drug_generator.py +0 -1
drug_generator.py
CHANGED
|
@@ -92,7 +92,6 @@ def get_sdf(ligand_list,output_path):
|
|
| 92 |
cmd = "obabel -:" + ligand + " -osdf -O " + filename + " --gen3d --forcefield mmff94"# --conformer --nconf 1 --score rmsd
|
| 93 |
#subprocess.check_call(cmd, shell=True)
|
| 94 |
try:
|
| 95 |
-
# 设置超时时间为 30 秒
|
| 96 |
output = subprocess.check_output(cmd, timeout=10)
|
| 97 |
except subprocess.TimeoutExpired:
|
| 98 |
pass
|
|
|
|
| 92 |
cmd = "obabel -:" + ligand + " -osdf -O " + filename + " --gen3d --forcefield mmff94"# --conformer --nconf 1 --score rmsd
|
| 93 |
#subprocess.check_call(cmd, shell=True)
|
| 94 |
try:
|
|
|
|
| 95 |
output = subprocess.check_output(cmd, timeout=10)
|
| 96 |
except subprocess.TimeoutExpired:
|
| 97 |
pass
|