Spaces:
Sleeping
Sleeping
SMeyersMrOvkill
commited on
Commit
·
6847a4d
1
Parent(s):
a5c4680
reddy
Browse files
app.py
CHANGED
|
@@ -1,9 +1,14 @@
|
|
| 1 |
import gradio as gr
|
|
|
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
code_input = gr.inputs.Code(label="Enter your code here")
|
| 9 |
submit_button = gr.outputs.Button(label="Submit")
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
from llama_cpp import Llama
|
| 3 |
|
| 4 |
+
llm = Llama.from_pretrained("", filename="", n_ctx=16384, n_gpu_layers=99)
|
| 5 |
+
|
| 6 |
+
def code_block(txt, mdn):
|
| 7 |
+
return txt + (res := llm(
|
| 8 |
+
prompt=txt,
|
| 9 |
+
max_length=16384-len(txt),
|
| 10 |
+
stop=['###', '///', '\n\n\n\n'],
|
| 11 |
+
)['generated_text']), mdn+txt+res
|
| 12 |
|
| 13 |
code_input = gr.inputs.Code(label="Enter your code here")
|
| 14 |
submit_button = gr.outputs.Button(label="Submit")
|