Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,19 +1,24 @@
|
|
1 |
from flask import Flask, render_template, request
|
|
|
2 |
|
3 |
app = Flask(__name__)
|
4 |
|
5 |
@app.route('/')
|
6 |
def home():
|
7 |
-
return
|
8 |
|
9 |
@app.route('/chat')
|
10 |
def chat():
|
11 |
-
|
|
|
12 |
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
|
|
|
|
|
|
17 |
|
18 |
if __name__ == '__main__':
|
19 |
app.run(debug=True)
|
|
|
1 |
from flask import Flask, render_template, request
|
2 |
+
import gradio as gr
|
3 |
|
4 |
app = Flask(__name__)
|
5 |
|
6 |
@app.route('/')
|
7 |
def home():
|
8 |
+
return render_templates('index.html')
|
9 |
|
10 |
@app.route('/chat')
|
11 |
def chat():
|
12 |
+
def chatbot(input_text):
|
13 |
+
return {"output": f"Your input was: {input_text}"}
|
14 |
|
15 |
+
iface = gr.Interface(
|
16 |
+
fn=chatbot,
|
17 |
+
inputs=gr.Textbox(),
|
18 |
+
outputs=gr.Textbox(label="Response"),
|
19 |
+
title="Hotel Booking Chatbot",
|
20 |
+
)
|
21 |
+
return iface.launch()
|
22 |
|
23 |
if __name__ == '__main__':
|
24 |
app.run(debug=True)
|