paloma99 commited on
Commit
54e474d
1 Parent(s): 12ff379

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -3
app.py CHANGED
@@ -2,6 +2,7 @@ import gradio as gr
2
  from transformers import pipeline, AutoModelForCausalLM, AutoTokenizer
3
  import torch
4
  import theme
 
5
 
6
  theme = theme.Theme()
7
 
@@ -22,11 +23,12 @@ image_gradio_app = gr.Interface(
22
 
23
  # Cell 2: Chatbot Model
24
 
25
- def echo(message, history):
26
- return message
 
27
 
28
  chatbot_gradio_app = gr.ChatInterface(
29
- fn=echo,
30
  title="Green Greta",
31
  theme=theme
32
  )
 
2
  from transformers import pipeline, AutoModelForCausalLM, AutoTokenizer
3
  import torch
4
  import theme
5
+ import chatbot
6
 
7
  theme = theme.Theme()
8
 
 
23
 
24
  # Cell 2: Chatbot Model
25
 
26
+ def qa_response(user_message, chat_history, context):
27
+ response = qa_chain.predict(user_message, chat_history, context=context)
28
+ return response
29
 
30
  chatbot_gradio_app = gr.ChatInterface(
31
+ fn=qa_response,
32
  title="Green Greta",
33
  theme=theme
34
  )