Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,31 +1,31 @@
|
|
1 |
-
import gradio as gr
|
2 |
-
import pandas as pd
|
3 |
-
from chatbot.bot import QuestionAnsweringBot
|
4 |
-
import os
|
5 |
-
|
6 |
-
chunked_data_corpus_df = pd.read_csv(
|
7 |
-
|
8 |
-
bot = QuestionAnsweringBot(chunked_data_corpus_df)
|
9 |
-
|
10 |
-
def message_respond(message, history):
|
11 |
-
answer = bot.form_response(message)
|
12 |
-
return answer
|
13 |
-
|
14 |
-
gr.ChatInterface(
|
15 |
-
fn=message_respond,
|
16 |
-
type="messages",
|
17 |
-
title="RAG System for 'The Count of Monte Cristo' book",
|
18 |
-
description="Here you can ask any questions in the context of the book 'The Count of Monte Cristo'. API key is already provided.",
|
19 |
-
theme=gr.themes.Monochrome(font='Lora', text_size='lg', radius_size='sm'),
|
20 |
-
examples=["Who is Monte Cristo?",
|
21 |
-
"What is the title of Chapter 93",
|
22 |
-
"Why Edmond Dantes was in prison?",
|
23 |
-
"How many years does Edmon Dantes spent in prison?",
|
24 |
-
"Who said this sentence to whom 'Wait and hope_ (Fac et spera)'?",
|
25 |
-
"What is the title of Chapter 64?",
|
26 |
-
"Who is the president of the USA?",
|
27 |
-
"Who is the author of the book The Count of Monte Cristo?",
|
28 |
-
"Tell me about all the main identites in Monte Cristo?"
|
29 |
-
],
|
30 |
-
cache_examples=False,
|
31 |
).launch()
|
|
|
1 |
+
import gradio as gr
|
2 |
+
import pandas as pd
|
3 |
+
from chatbot.bot import QuestionAnsweringBot
|
4 |
+
import os
|
5 |
+
|
6 |
+
chunked_data_corpus_df = pd.read_csv("../data/chunked_data_corpus.csv"))
|
7 |
+
|
8 |
+
bot = QuestionAnsweringBot(chunked_data_corpus_df)
|
9 |
+
|
10 |
+
def message_respond(message, history):
|
11 |
+
answer = bot.form_response(message)
|
12 |
+
return answer
|
13 |
+
|
14 |
+
gr.ChatInterface(
|
15 |
+
fn=message_respond,
|
16 |
+
type="messages",
|
17 |
+
title="RAG System for 'The Count of Monte Cristo' book",
|
18 |
+
description="Here you can ask any questions in the context of the book 'The Count of Monte Cristo'. API key is already provided.",
|
19 |
+
theme=gr.themes.Monochrome(font='Lora', text_size='lg', radius_size='sm'),
|
20 |
+
examples=["Who is Monte Cristo?",
|
21 |
+
"What is the title of Chapter 93",
|
22 |
+
"Why Edmond Dantes was in prison?",
|
23 |
+
"How many years does Edmon Dantes spent in prison?",
|
24 |
+
"Who said this sentence to whom 'Wait and hope_ (Fac et spera)'?",
|
25 |
+
"What is the title of Chapter 64?",
|
26 |
+
"Who is the president of the USA?",
|
27 |
+
"Who is the author of the book The Count of Monte Cristo?",
|
28 |
+
"Tell me about all the main identites in Monte Cristo?"
|
29 |
+
],
|
30 |
+
cache_examples=False,
|
31 |
).launch()
|