Spaces:
Sleeping
Sleeping
AI
commited on
Commit
•
dce77ea
1
Parent(s):
129c921
Update app.py
Browse files
app.py
CHANGED
@@ -1,12 +1,10 @@
|
|
1 |
from langchain_community.llms import Ollama
|
2 |
import gradio as gr
|
3 |
|
4 |
-
def generate(
|
5 |
-
|
|
|
|
|
6 |
|
7 |
-
|
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()
|
|
|
|
|
|
|
|