File size: 617 Bytes
106132f
 
 
 
 
 
 
 
 
 
0564d5c
106132f
 
 
 
 
2f86a51
106132f
22e7460
106132f
2f86a51
106132f
2f86a51
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from transformers import pipeline
import gradio as gr
from fastapi import FastAPI
from gradio_client import Client
from typing import Union
import uvicorn


app = FastAPI()

chatbot = pipeline(model="Kaludi/Customer-Support-Assistant-V2")

def DS_chatbot(message,history):
    conversation = chatbot(message)
    return conversation[0]['generated_text']

io = gr.ChatInterface(DS_chatbot, title="Customer Service Bot", description="Enter your query.")


# Mount the Gradio app onto the FastAPI app
app = gr.mount_gradio_app(app, io, path='/')
if __name__ == "__main__":
    uvicorn.run(app, host="0.0.0.0", port=7860)