Spaces:
Sleeping
Sleeping
app.py
Browse filesThis is the app.py
app.py
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from langchain.llms import CTransformers
|
3 |
+
|
4 |
+
# Load model
|
5 |
+
llm = CTransformers(
|
6 |
+
model="IcedSundae/Krog-v1",
|
7 |
+
model_type="llama",
|
8 |
+
config={"gpu_layers": 0} # Change to GPU layers if using paid plan
|
9 |
+
)
|
10 |
+
|
11 |
+
def chat(message):
|
12 |
+
response = llm(message)
|
13 |
+
return response
|
14 |
+
|
15 |
+
# Create UI
|
16 |
+
iface = gr.Interface(fn=chat, inputs="text", outputs="text", title="Krog")
|
17 |
+
iface.launch()
|