Instructions to use ticoAg/gpt2-tigerzh-med-sft-v1 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use ticoAg/gpt2-tigerzh-med-sft-v1 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="ticoAg/gpt2-tigerzh-med-sft-v1")# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("ticoAg/gpt2-tigerzh-med-sft-v1") model = AutoModelForCausalLM.from_pretrained("ticoAg/gpt2-tigerzh-med-sft-v1", device_map="auto") - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use ticoAg/gpt2-tigerzh-med-sft-v1 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "ticoAg/gpt2-tigerzh-med-sft-v1" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "ticoAg/gpt2-tigerzh-med-sft-v1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/ticoAg/gpt2-tigerzh-med-sft-v1
- SGLang
How to use ticoAg/gpt2-tigerzh-med-sft-v1 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 "ticoAg/gpt2-tigerzh-med-sft-v1" \ --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": "ticoAg/gpt2-tigerzh-med-sft-v1", "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 "ticoAg/gpt2-tigerzh-med-sft-v1" \ --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": "ticoAg/gpt2-tigerzh-med-sft-v1", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use ticoAg/gpt2-tigerzh-med-sft-v1 with Docker Model Runner:
docker model run hf.co/ticoAg/gpt2-tigerzh-med-sft-v1
Usage
Be careful to use, it's a toy-level interrupted checkpoint with only 3000 steps for validate the custom loss from [Firefly]
git clone https://github.com/hiyouga/LLaMA-Efficient-Tuning
cd LLaMA-Efficient-Tuning
pip install -r requirements.txt
Then Run
python src/web_demo.py \
--model_name_or_path ticoAg/gpt2-tigerzh-med-sft-v1 \
--template ziya
Example
Q:最近经常早上头疼,怎么办阿
A:您好,根据您的描述,您可能正在经历头痛和脱垂的情况。这些症状可能与您的生活习惯有关,例如头痛、肌肉疲劳、胸闷、心慌、心跳加快等。建议您尽快就医,以便得到更好的治疗和治疗效果。
同时,您可以多喝水,保持身体水分摄入,并避免过度劳累和情绪波动。如果出现头痛、脱垂的情况,可以考虑使用一些药物治疗,如抗生素、糖皮质激素等。但是,请注意,不要过度使用药物,如果出现不良反应,请及时就医。
最后,如果您有任何疑问或需要进一步的帮助,请随时与医生联系。祝您早日康复!
- Downloads last month
- 11