Quantifying the Carbon Emissions of Machine Learning
Paper
•
1910.09700
•
Published
•
27
This is the Gemma-2b-IT model fine-tuned for the Python code generation task.
This is the model card of a 🤗 transformers model that has been pushed on the Hub. This model card has been automatically generated.
Use this model to generate Python code.
This model is trained on very basic Python code, so it might not be able to handle complex code.
Use the code below to get started with the model.
# Load model directly
from transformers import AutoTokenizer, AutoModelForCausalLM
model_id = "mrSoul7766/gemma-2b-it-python-code-gen-adapter"
tokenizer = AutoTokenizer.from_pretrained(model_id)
model = AutoModelForCausalLM.from_pretrained(model_id)
text = """<start_of_turn>how to covert json to dataframe.<end_of_turn>
<start_of_turn>model"""
#device = "cuda:0"
inputs = tokenizer(text, return_tensors="pt")
outputs = model.generate(**inputs, max_new_tokens=200)
print(tokenizer.decode(outputs[0], skip_special_tokens=True))
Fine-tuning Data: flytech/python-codes-25k
iamtarun/python_code_instructions_18k_alpaca
import json
import pandas as pd
# Load the JSON data
with open('data.json', 'r') as f:
data = json.load(f)
# Create the DataFrame
df = pd.DataFrame(data)
Carbon emissions can be estimated using the Machine Learning Impact calculator presented in Lacoste et al. (2019).