Simple chatbot interface for ollama
This commit is contained in:
parent
d46dedbbfa
commit
03bd4ed1d3
19
examples/langchain-docscanner/askGradio.py
Normal file
19
examples/langchain-docscanner/askGradio.py
Normal 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()
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user