Text Generation
PEFT
Safetensors
Transformers
qwen2
lora
coding
code-generation
conversational
text-generation-inference
Instructions to use girish00/ConicAI_LLM_model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- PEFT
How to use girish00/ConicAI_LLM_model with PEFT:
from peft import PeftModel from transformers import AutoModelForCausalLM base_model = AutoModelForCausalLM.from_pretrained("Qwen/Qwen2.5-Coder-0.5B-Instruct") model = PeftModel.from_pretrained(base_model, "girish00/ConicAI_LLM_model") - Transformers
How to use girish00/ConicAI_LLM_model with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="girish00/ConicAI_LLM_model") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("girish00/ConicAI_LLM_model") model = AutoModelForCausalLM.from_pretrained("girish00/ConicAI_LLM_model", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use girish00/ConicAI_LLM_model with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "girish00/ConicAI_LLM_model" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "girish00/ConicAI_LLM_model", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/girish00/ConicAI_LLM_model
- SGLang
How to use girish00/ConicAI_LLM_model 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 "girish00/ConicAI_LLM_model" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "girish00/ConicAI_LLM_model", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "girish00/ConicAI_LLM_model" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "girish00/ConicAI_LLM_model", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use girish00/ConicAI_LLM_model with Docker Model Runner:
docker model run hf.co/girish00/ConicAI_LLM_model
update endpoint helper files
Browse files285 unmodified lines2862872882892902912922932942952962972982 unmodified lines30130230330430530630730830931031131231331431531631731831932022 unmodified lines343344345346347348349350351352353285 unmodified linesparser.add_argument("--base-model", type=str, default="Qwen/Qwen2.5-Coder-0.5B-Instruct")parser.add_argument("--prompt", type=str, required=True)parser.add_argument("--max-new-tokens", type=int, default=320)parser.add_argument("--temperature", type=float, default=0.25)parser.add_argument("--top-p", type=float, default=0.9)parser.add_argument("--do-sample", action="store_true")args = parser.parse_args()if not os.path.exists(args.model_path):raise FileNotFoundError(f"Model path not found: {args.model_path}. Train first using run_pipeline.py.")2 unmodified linesfull_model_weights_present = has_full_model_weights(args.model_path)if os.path.exists(adapter_config_path) and adapter_weights_present:peft_config = PeftConfig.from_pretrained(args.model_path)base_model_name = peft_config.base_model_name_or_path or args.base_modeltokenizer = AutoTokenizer.from_pretrained(base_model_name)base_model = AutoModelForCausalLM.from_pretrained(base_model_name,torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,)model = PeftModel.from_pretrained(base_model, args.model_path)elif full_model_weights_present and not os.path.exists(adapter_config_path):tokenizer = AutoTokenizer.from_pretrained(args.model_path)model = AutoModelForCausalLM.from_pretrained(args.model_path,torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,)else:# Graceful fallback when local model folder has config/tokenizer but no weight files.fallback_base = args.base_model22 unmodified lines),file=sys.stderr,)tokenizer = AutoTokenizer.from_pretrained(fallback_base)model = AutoModelForCausalLM.from_pretrained(fallback_base,torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,)if tokenizer.pad_token is None:tokenizer.pad_token = tokenizer.eos_tokenmodel.eval()285 unmodified lines2862872882892902912922932942952962972982993003013023033042 unmodified lines30730830931031131231331431531631731831932032132232332432532632732832933033133233333422 unmodified lines357358359360361362363364365366367368369370371285 unmodified linesparser.add_argument("--base-model", type=str, default="Qwen/Qwen2.5-Coder-0.5B-Instruct")parser.add_argument("--prompt", type=str, required=True)parser.add_argument("--max-new-tokens", type=int, default=320)parser.add_argument("--temperature", type=float, default=0.25)parser.add_argument("--top-p", type=float, default=0.9)parser.add_argument("--do-sample", action="store_true")parser.add_argument("--allow-downloads",action="store_true",help="Allow Transformers to download missing model files from Hugging Face.",)args = parser.parse_args()local_files_only = not args.allow_downloadsif not os.path.exists(args.model_path):raise FileNotFoundError(f"Model path not found: {args.model_path}. Train first using run_pipeline.py.")2 unmodified linesfull_model_weights_present = has_full_model_weights(args.model_path)if os.path.exists(adapter_config_path) and adapter_weights_present:peft_config = PeftConfig.from_pretrained(args.model_path)base_model_name = peft_config.base_model_name_or_path or args.base_modeltokenizer = AutoTokenizer.from_pretrained(base_model_name,local_files_only=local_files_only,)base_model = AutoModelForCausalLM.from_pretrained(base_model_name,torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,local_files_only=local_files_only,)model = PeftModel.from_pretrained(base_model, args.model_path)elif full_model_weights_present and not os.path.exists(adapter_config_path):tokenizer = AutoTokenizer.from_pretrained(args.model_path,local_files_only=local_files_only,)model = AutoModelForCausalLM.from_pretrained(args.model_path,torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,local_files_only=local_files_only,)else:# Graceful fallback when local model folder has config/tokenizer but no weight files.fallback_base = args.base_model22 unmodified lines),file=sys.stderr,)tokenizer = AutoTokenizer.from_pretrained(fallback_base,local_files_only=local_files_only,)model = AutoModelForCausalLM.from_pretrained(fallback_base,torch_dtype=torch.float16 if torch.cuda.is_available() else torch.float32,local_files_only=local_files_only,)if tokenizer.pad_token is None:tokenizer.pad_token = tokenizer.eos_tokenmodel.eval()
infer_local.py+44-26