Simple chatbot interface for ollama

This commit is contained in:
suoko 2023-10-28 09:00:22 +02:00 committed by GitHub
parent d46dedbbfa
commit 03bd4ed1d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,19 @@
import random
import gradio as gr
from langchain.llms import Ollama
ollama = Ollama(base_url='http://localhost:11434', model="llama2")
def random_response(message, history):
return ollama(message)
demo = gr.ChatInterface(random_response, title="Echo Bot")
if __name__ == "__main__":
demo.launch()