Update app.py
Browse files
app.py
CHANGED
@@ -6,7 +6,6 @@ import chromadb.config
|
|
6 |
from chromadb.config import Settings
|
7 |
from transformers import T5ForConditionalGeneration, AutoTokenizer
|
8 |
import torch
|
9 |
-
import gradio as gr
|
10 |
import uuid
|
11 |
from sentence_transformers import SentenceTransformer
|
12 |
import os
|
@@ -91,7 +90,6 @@ def run_query(file, history, query):
|
|
91 |
def upload_pdf(file):
|
92 |
try:
|
93 |
if file is not None:
|
94 |
-
file_name = file.name
|
95 |
return 'Successfully uploaded!'
|
96 |
else:
|
97 |
return "No file uploaded."
|
@@ -123,8 +121,8 @@ with gr.Blocks() as demo:
|
|
123 |
#.then(
|
124 |
# generate_response, inputs =[chatbot,],outputs = chatbot,)
|
125 |
|
126 |
-
|
127 |
|
128 |
-
|
|
|
129 |
|
130 |
|
|
|
6 |
from chromadb.config import Settings
|
7 |
from transformers import T5ForConditionalGeneration, AutoTokenizer
|
8 |
import torch
|
|
|
9 |
import uuid
|
10 |
from sentence_transformers import SentenceTransformer
|
11 |
import os
|
|
|
90 |
def upload_pdf(file):
|
91 |
try:
|
92 |
if file is not None:
|
|
|
93 |
return 'Successfully uploaded!'
|
94 |
else:
|
95 |
return "No file uploaded."
|
|
|
121 |
#.then(
|
122 |
# generate_response, inputs =[chatbot,],outputs = chatbot,)
|
123 |
|
|
|
124 |
|
125 |
+
gr.close_all()
|
126 |
+
demo.launch(share=True)
|
127 |
|
128 |
|