Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import ollama
|
3 |
+
|
4 |
+
MODEL = "llama3"
|
5 |
+
|
6 |
+
def chatbot(message, history):
|
7 |
+
response = ollama.chat(model=MODEL, messages=[{"role": "user", "content": message}])
|
8 |
+
return response['message']['content']
|
9 |
+
|
10 |
+
with gr.Blocks() as demo:
|
11 |
+
gr.Markdown("# 💬 Simple Chatbot using Llama3 (Ollama)")
|
12 |
+
chatbot_ui = gr.ChatInterface(fn=chatbot)
|
13 |
+
demo.launch()
|