Jhakx's picture
Update app.py
a9c2757 verified
raw
history blame contribute delete
561 Bytes
import gradio as gr
import spaces
class CodeLlamaUI:
def __init__(self):
@spaces.GPU
def generate_code(prompt):
# Assuming you have a function to interact with the CodeLlama model
return code_generation_function(prompt)
self.gr = gr.Interface(
fn=generate_code,
inputs=gr.Textbox(label="Prompt"),
outputs=gr.CodeEditor(language="python"),
title="CodeLlama Code Generation"
)
self.gr.launch()
if __name__ == "__main__":
ui = CodeLlamaUI()