Jhakx commited on
Commit
398fc8a
·
verified ·
1 Parent(s): 293e760

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -4
app.py CHANGED
@@ -1,5 +1,21 @@
1
  import gradio as gr
2
- import spaces
3
- def __init__(self):
4
- @spaces.GPU
5
- self.gr.load("models/codellama/CodeLlama-34b-Instruct-hf").launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import gradio as gr
2
+ from spaces import spaces
3
+
4
+ class CodeLlamaUI:
5
+ def __init__(self):
6
+ @spaces.GPU
7
+ def generate_code(prompt):
8
+ # Assuming you have a function to interact with the CodeLlama model
9
+ return code_generation_function(prompt)
10
+
11
+ self.gr = gr.Interface(
12
+ fn=generate_code,
13
+ inputs=gr.Textbox(label="Prompt"),
14
+ outputs=gr.CodeEditor(language="python"),
15
+ title="CodeLlama Code Generation"
16
+ )
17
+
18
+ self.gr.launch()
19
+
20
+ if __name__ == "__main__":
21
+ ui = CodeLlamaUI()