[new] add gradio and hf spaces deployments (#1042)
This commit is contained in:
18
embedchain/deployment/gradio.app/app.py
Normal file
18
embedchain/deployment/gradio.app/app.py
Normal file
@@ -0,0 +1,18 @@
|
||||
import os
|
||||
|
||||
import gradio as gr
|
||||
|
||||
from embedchain import Pipeline as App
|
||||
|
||||
os.environ["OPENAI_API_KEY"] = "sk-xxx"
|
||||
|
||||
app = App()
|
||||
|
||||
|
||||
def query(message, history):
|
||||
return app.chat(message)
|
||||
|
||||
|
||||
demo = gr.ChatInterface(query)
|
||||
|
||||
demo.launch()
|
||||
2
embedchain/deployment/gradio.app/requirements.txt
Normal file
2
embedchain/deployment/gradio.app/requirements.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
gradio==4.11.0
|
||||
embedchain
|
||||
Reference in New Issue
Block a user