Spaces:
Runtime error
Runtime error
Update app.py
Browse files
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
|
26 |
-
|
|
|
27 |
|
28 |
chatbot_gradio_app = gr.ChatInterface(
|
29 |
-
fn=
|
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 |
)
|