Instructions to use JohnnyZeppelin/sql-ocr with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use JohnnyZeppelin/sql-ocr with Transformers:
# pip install -U transformers accelerate # Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("JohnnyZeppelin/sql-ocr", device_map="auto") - Notebooks
- Google Colab
- Kaggle
Codex commited on
Commit ·
7f6b209
1
Parent(s): ddf9b1b
Add lightweight table model base64 weights
Browse filesFiles changed (10)
- lightweight_table_model_base64/README.mdAdded+10
- lightweight_table_model_base64/config.jsonAdded+39
- lightweight_table_model_base64/generation_config.jsonAdded+6
- lightweight_table_model_base64/merges.txtAdded
- lightweight_table_model_base64/model.safetensors.base64Added
- lightweight_table_model_base64/special_tokens_map.jsonAdded+24
- lightweight_table_model_base64/tokenizer.jsonAdded
- lightweight_table_model_base64/tokenizer_config.jsonAdded+22
- lightweight_table_model_base64/training_metadata.jsonAdded+6
- lightweight_table_model_base64/vocab.jsonAdded
12345678910This folder contains the lightweight table-to-SQL adapter trained locally in this task.
Files:- `model.safetensors.base64`: base64-encoded weights (decode with `base64 -d model.safetensors.base64 > model.safetensors`).- Tokenizer/config files copied from the training output to load the model after decoding.
Command to reconstruct the weights:```bashbase64 -d model.safetensors.base64 > model.safetensors```123456789101112131415161718192021222324252627282930313233343536373839{ "_name_or_path": "/tmp/tiny-gpt2", "activation_function": "gelu_new", "architectures": [ "GPT2LMHeadModel" ], "attn_pdrop": 0.1, "bos_token_id": 50256, "embd_pdrop": 0.1, "eos_token_id": 50256, "initializer_range": 0.02, "layer_norm_epsilon": 1e-05, "model_type": "gpt2", "n_ctx": 1024, "n_embd": 2, "n_head": 2, "n_inner": null, "n_layer": 2, "n_positions": 1024, "reorder_and_upcast_attn": false, "resid_pdrop": 0.1, "scale_attn_by_inverse_layer_idx": false, "scale_attn_weights": true, "summary_activation": null, "summary_first_dropout": 0.1, "summary_proj_to_labels": true, "summary_type": "cls_index", "summary_use_proj": true, "task_specific_params": { "text-generation": { "do_sample": true, "max_length": 50 } }, "torch_dtype": "float32", "transformers_version": "4.46.3", "use_cache": true, "vocab_size": 50257}123456{ "_from_model_config": true, "bos_token_id": 50256, "eos_token_id": 50256, "transformers_version": "4.46.3"}123456789101112131415161718192021222324{ "bos_token": { "content": "<|endoftext|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false }, "eos_token": { "content": "<|endoftext|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false }, "pad_token": "<|endoftext|>", "unk_token": { "content": "<|endoftext|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false }}12345678910111213141516171819202122{ "add_bos_token": false, "add_prefix_space": false, "added_tokens_decoder": { "50256": { "content": "<|endoftext|>", "lstrip": false, "normalized": true, "rstrip": false, "single_word": false, "special": true } }, "bos_token": "<|endoftext|>", "clean_up_tokenization_spaces": false, "eos_token": "<|endoftext|>", "errors": "replace", "model_max_length": 1024, "pad_token": "<|endoftext|>", "tokenizer_class": "GPT2Tokenizer", "unk_token": "<|endoftext|>"}123456{ "model_name": "/tmp/tiny-gpt2", "max_steps": 30, "learning_rate": 0.0005, "num_samples": 5}lightweight_table_model_base64/README.mdAdded+10
lightweight_table_model_base64/config.jsonAdded+39
lightweight_table_model_base64/generation_config.jsonAdded+6
lightweight_table_model_base64/merges.txtAdded
lightweight_table_model_base64/model.safetensors.base64Added
lightweight_table_model_base64/special_tokens_map.jsonAdded+24
lightweight_table_model_base64/tokenizer.jsonAdded
lightweight_table_model_base64/tokenizer_config.jsonAdded+22
lightweight_table_model_base64/training_metadata.jsonAdded+6
lightweight_table_model_base64/vocab.jsonAdded