Spaces:
Runtime error
Runtime error
Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from langchain_community.llms import Ollama
|
| 2 |
+
import gradio as gr
|
| 3 |
+
|
| 4 |
+
def generate(name):
|
| 5 |
+
llm = Ollama(model="codellama")
|
| 6 |
+
|
| 7 |
+
response = llm.invoke(name)
|
| 8 |
+
|
| 9 |
+
return response
|
| 10 |
+
|
| 11 |
+
iface = gr.ChatInterface(fn=generate)
|
| 12 |
+
iface.launch()
|