Update src/interface.py
Browse files- src/interface.py +0 -15
src/interface.py
CHANGED
@@ -1,21 +1,6 @@
|
|
1 |
import csv
|
2 |
import gradio as gr
|
3 |
|
4 |
-
#NEW
|
5 |
-
# Function to update chat history and conversation history
|
6 |
-
def update_chat_history(user_input, bot_response):
|
7 |
-
chat_history.update(value=chat_history.value + [(user_input, bot_response)])
|
8 |
-
conversation_history.append([user_input, bot_response])
|
9 |
-
|
10 |
-
# Function to download conversation history
|
11 |
-
def download_conversation_history():
|
12 |
-
with open('conversation_history.csv', 'w', newline='') as file:
|
13 |
-
writer = csv.writer(file)
|
14 |
-
writer.writerow(["User Input", "Bot Response"])
|
15 |
-
writer.writerows(conversation_history)
|
16 |
-
return "conversation_history.csv"
|
17 |
-
#NEW
|
18 |
-
|
19 |
# Gradio application setup
|
20 |
def create_demo():
|
21 |
with gr.Blocks(title="LLAMA 3 Rag Chat pdf", theme="Monochrome") as demo:
|
|
|
1 |
import csv
|
2 |
import gradio as gr
|
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
# Gradio application setup
|
5 |
def create_demo():
|
6 |
with gr.Blocks(title="LLAMA 3 Rag Chat pdf", theme="Monochrome") as demo:
|