AI commited on
Commit
dce77ea
1 Parent(s): 129c921

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -8
app.py CHANGED
@@ -1,12 +1,10 @@
1
  from langchain_community.llms import Ollama
2
  import gradio as gr
3
 
4
- def generate(name):
5
- llm = Ollama(model="openchat")
 
 
6
 
7
- response = llm.invoke(name)
8
-
9
- return response
10
-
11
- iface = gr.ChatInterface(fn=generate)
12
- iface.launch()
 
1
  from langchain_community.llms import Ollama
2
  import gradio as gr
3
 
4
+ def generate(user_input):
5
+ llm = Ollama(model="openchat")
6
+ response = llm.invoke(user_input)
7
+ return response
8
 
9
+ iface = gr.Interface(fn=generate, inputs="text", outputs="text", title="Ollama Chat", description="Chat with Ollama by entering your message.")
10
+ iface.launch()