Giter Site home page Giter Site logo

rafaelvp-db / db-ancient-code-translation Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 1.0 214 KB

Simple repo showing code-to-code and code-to-text capabilities using LLMs on Databricks.

Python 67.20% Shell 32.80%
code2code databricks llm plsql pyspark starchat code2text huggingface huggingface-transformers code-conversion

db-ancient-code-translation's Introduction

Databricks Ancient Code Translation

huggingface pytorch pyspark databricks plsql


TLDR;

This repo demonstrates code translation (Code to Text, Code to Code) capabilities using Large Language Models (LLMs) on Databricks

Getting Started

  • Clone this repo into your Databricks Workspace
  • Configure a Databricks single node cluster with Databricks Runtime 13.2 for Machine Learning and an NVIDIA A100 GPU (A10 might also work, though with lower floating point precision)
    • A100 Instances On Azure: Standard_NC24ads_A100_v4 instances
    • A100 Instances On AWS: EC2 P4d instances
  • Install the following libraries into the cluster (you can also do it directly in the notebooks and leverage requirements.txt for that):
accelerate==0.21.0
ninja
alibi
einops
transformers
triton
xformers
  • Run the notebooks from the notebooks folder

Roadmap

  • PL/SQL
    • Generating code explanations (code to text)
    • Converting to PySpark
  • SAS
  • Snowflake

Authors

Reference

Appendix

Evaluation

To evaluate StarCoder and its derivatives, you can use the BigCode-Evaluation-Harness for evaluating Code LLMs.

Inference hardware requirements

In FP32 the model requires more than 60GB of RAM, you can load it in FP16 or BF16 in ~30GB, or in 8bit under 20GB of RAM with

# make sure you have accelerate and bitsandbytes installed
from transformers import AutoModelForCausalLM, AutoTokenizer

tokenizer = AutoTokenizer.from_pretrained("bigcode/starcoder")
# for fp16 replace with  `load_in_8bit=True` with   `torch_dtype=torch.float16`
model = AutoModelForCausalLM.from_pretrained("bigcode/starcoder", device_map="auto", load_in_8bit=True)
print(f"Memory footprint: {model.get_memory_footprint() / 1e6:.2f} MB")
Memory footprint: 15939.61 MB

db-ancient-code-translation's People

Contributors

rafaelvp-db avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

andreasjaeck

db-ancient-code-translation's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.