Edit model card

iTab-LLM

iTab-LLM is the Llama-2 7B model further trained with massive tables. This model is pretrained dedicating to solving the predictive tasks related to tabular data. For the details of our model, please refer to our paper: Unleashing the Potential of Large Language Models for Predictive Tabular Tasks in Data Science link

Demo Usage

Classification

from transformers import LlamaForSequenceClassification

model_name_or_path = "OldBirdAZ/itab-llm"
model = LlamaForSequenceClassification.from_pretrained(
    model_name_or_path,
    num_labels=num_labels,
)
tokenizer = LlamaTokenizer.from_pretrained(tokenizer_name_or_path)
tokenizer.pad_token = tokenizer.eos_token
model.config.pad_token_id = model.config.eos_token_id

Regression

You could build model resemble to LlamaForSequenceClassification, outputing to single numerical value. The model can be finetuned with the optimization of minimizing MSE loss.

Zero-shot Prediction

from transformers import AutoModelForCausalLM
import tensor_parallel as tp


model = AutoModelForCausalLM.from_pretrained(
    model_name_or_path, 
    use_flash_attention_2="flash_attention_2", 
    torch_dtype=torch.bfloat16
)
model = tp.tensor_parallel(model, sharded=True)


prompt_str = "YOUR-PROMPT"
input_ids = prompt['input_ids'].to(model.device)
with torch.no_grad():
  response_result = model.generate(
      input_ids,
      max_new_tokens=max_dec_len,
      output_scores=True,
      return_dict_in_generate=True,
      num_return_sequences=1,
      remove_invalid_values=True,
  )
response = tokenizer.decode(response_result["sequences"][0][input_ids.shape[1]:], skip_special_tokens=True).strip()
result["generated_text"] = response.split("\n")[0].strip()

Ethical Considerations and Limitations

This model is the further pretrained version of Llama-2 7B over tables. Because the pretraining data mainly collected from Kaggle, you are required to rigorously follows Kaggle's terms and licensing agreements, adhering to legal and ethical standards if you would like to use this model. In addition, you also need to adhere the corresponding license and requirement of Llama-2 7B. Testing conducted to date has been in English, and has not covered, nor could it cover all scenarios. For these reasons, as with all LLMs, iTab-LLM’s potential outputs cannot be predicted in advance, and the model may in some instances produce inaccurate, biased or other objectionable responses to user prompts. Therefore, before deploying any applications of this model or applications based on this model, developers should perform safety testing and tuning tailored to their specific applications of the model.

Downloads last month
10
Safetensors
Model size
6.74B params
Tensor type
BF16
·