Instructions to use chaoyi-wu/PMC_LLAMA_7B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use chaoyi-wu/PMC_LLAMA_7B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="chaoyi-wu/PMC_LLAMA_7B")# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("chaoyi-wu/PMC_LLAMA_7B") model = AutoModelForCausalLM.from_pretrained("chaoyi-wu/PMC_LLAMA_7B") - Inference
- Notebooks
- Google Colab
- Kaggle
- Local Apps
- vLLM
How to use chaoyi-wu/PMC_LLAMA_7B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "chaoyi-wu/PMC_LLAMA_7B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "chaoyi-wu/PMC_LLAMA_7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }'Use Docker
docker model run hf.co/chaoyi-wu/PMC_LLAMA_7B
- SGLang
How to use chaoyi-wu/PMC_LLAMA_7B 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 "chaoyi-wu/PMC_LLAMA_7B" \ --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": "chaoyi-wu/PMC_LLAMA_7B", "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 "chaoyi-wu/PMC_LLAMA_7B" \ --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": "chaoyi-wu/PMC_LLAMA_7B", "prompt": "Once upon a time,", "max_tokens": 512, "temperature": 0.5 }' - Docker Model Runner
How to use chaoyi-wu/PMC_LLAMA_7B with Docker Model Runner:
docker model run hf.co/chaoyi-wu/PMC_LLAMA_7B
How to do text summarization using this model?
#2
by bansaloni - opened
I am getting this error when I tried using AutoModelForSeq2SeqLM.
ValueError: Unrecognized configuration class <class 'transformers.models.llama.configuration_llama.LlamaConfig'> for this kind of AutoModel: AutoModelForSeq2SeqLM.
Model type should be one of BartConfig, BigBirdPegasusConfig, BlenderbotConfig, BlenderbotSmallConfig, EncoderDecoderConfig, FSMTConfig, GPTSanJapaneseConfig, LEDConfig, LongT5Config, M2M100Config, MarianConfig, MBartConfig, MT5Config, MvpConfig, NllbMoeConfig, PegasusConfig, PegasusXConfig, PLBartConfig, ProphetNetConfig, SwitchTransformersConfig, T5Config, XLMProphetNetConfig. ```
It depends on the Llama classes in transformers. It seems transformers does not realize this function for Llama.
got it. Thanks
bansaloni changed discussion status to closed