Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import ollama
|
2 |
+
import gradio as gr
|
3 |
+
|
4 |
+
def chat(prompt):
|
5 |
+
response = ollama.chat(model="mistral", messages=[{"role": "user", "content": prompt}])
|
6 |
+
return response["message"]["content"]
|
7 |
+
|
8 |
+
iface = gr.Interface(fn=chat, inputs="text", outputs="text")
|
9 |
+
iface.launch()
|