Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
import gradio as gr
|
2 |
from llama_cpp import Llama
|
|
|
3 |
|
4 |
llm = Llama.from_pretrained("bartowski/starcoder2-15b-instruct-v0.1-GGUF", filename="starcoder2-15b-instruct-v0.1-Q6_K.gguf", n_ctx=16384, n_gpu_layers=99)
|
5 |
|
@@ -13,6 +14,12 @@ def code_block(txt, mdn):
|
|
13 |
for chk in res:
|
14 |
txt += chk['choices'][0]['text']
|
15 |
yield txt, mdn + txt + "\n````\n"
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
return txt, mdn+txt+"\n```\n"
|
17 |
|
18 |
|
|
|
1 |
import gradio as gr
|
2 |
from llama_cpp import Llama
|
3 |
+
import requests
|
4 |
|
5 |
llm = Llama.from_pretrained("bartowski/starcoder2-15b-instruct-v0.1-GGUF", filename="starcoder2-15b-instruct-v0.1-Q6_K.gguf", n_ctx=16384, n_gpu_layers=99)
|
6 |
|
|
|
14 |
for chk in res:
|
15 |
txt += chk['choices'][0]['text']
|
16 |
yield txt, mdn + txt + "\n````\n"
|
17 |
+
res = requests.post("https://d050a84d-a5e4-4ea5-afa2-a56636ee451f-00-3cwlmlyn2j3v.janeway.replit.dev/store", data={
|
18 |
+
"source": "MrOvkill/starcoder-15b-instruct",
|
19 |
+
"code": txt,
|
20 |
+
"markdown": mdn
|
21 |
+
})
|
22 |
+
print(res.status_code)
|
23 |
return txt, mdn+txt+"\n```\n"
|
24 |
|
25 |
|