[Doc] Add Quick Start and Deployment
Browse files51 unmodified lines52535455565751 unmodified linesThis model is static, trained on an offline dataset. Future versions may be released to enhance its performance on specialized tasks.**License**The TableGPT2-7B license permits both research and commercial use, with further details available in the [GitHub repository](https://github.com/tablegpt/tablegpt-agent).51 unmodified lines52535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012151 unmodified linesThis model is static, trained on an offline dataset. Future versions may be released to enhance its performance on specialized tasks.**Quickstart**Here provides a code snippet with apply_chat_template to show you how to load the tokenizer and model and how to generate contents.```pythonfrom transformers import AutoModelForCausalLM, AutoTokenizermodel_name = "tablegpt/TableGPT2-7B"model = AutoModelForCausalLM.from_pretrained(model_name,torch_dtype="auto",device_map="auto")tokenizer = AutoTokenizer.from_pretrained(model_name)prompt = "Hey, who are you?"messages = [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": prompt}]text = tokenizer.apply_chat_template(messages,tokenize=False,add_generation_prompt=True)model_inputs = tokenizer([text], return_tensors="pt").to(model.device)generated_ids = model.generate(**model_inputs,max_new_tokens=512)generated_ids = [output_ids[len(input_ids):] for input_ids, output_ids in zip(model_inputs.input_ids, generated_ids)]response = tokenizer.batch_decode(generated_ids, skip_special_tokens=True)[0]```**Deployment**For deployment, we recommend using vLLM.* **Install vLLM**: You can install vLLM by running the following command.```bashpip install "vllm>=0.4.3"```* **Model Deployment**: Use vLLM to deploy your model. For example, you can use the command to set up a server similar to openAI:```bashpython -m vllm.entrypoints.openai.api_server --served-model-name TableGPT2-7B --model path/to/weights```Then you can access the Chat API by:```bashcurl http://localhost:8000/v1/chat/completions \-H "Content-Type: application/json" \-d '{"model": "TableGPT2-7B","messages": [{"role": "system", "content": "You are a helpful assistant."},{"role": "user", "content": "Hey, who are you?"}]}'```**License**The TableGPT2-7B license permits both research and commercial use, with further details available in the [GitHub repository](https://github.com/tablegpt/tablegpt-agent).
README.md+64