Download app.py from Jhakx/codellama-CodeLlama-34b-Instruct-hf2: direct link, hf CLI and curl.
- Browser
- Download file 561 Bytes
-
https://huggingface.co/spaces/Jhakx/codellama-CodeLlama-34b-Instruct-hf2/resolve/main/app.py
- Command line
-
hf download hf://spaces/Jhakx/codellama-CodeLlama-34b-Instruct-hf2/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Jhakx/codellama-CodeLlama-34b-Instruct-hf2/resolve/main/app.py
561 Bytes
| import gradio as gr | |
| import spaces | |
| class CodeLlamaUI: | |
| def __init__(self): | |
| 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() |