stivenDR14
commited on
Commit
·
f26fb75
1
Parent(s):
8dd0690
testing notatons deleted
Browse files
app.py
CHANGED
@@ -58,19 +58,15 @@ class PDFProcessorUI:
|
|
58 |
else:
|
59 |
return gr.update(visible=False), gr.update(visible=False)
|
60 |
|
61 |
-
@spaces.GPU
|
62 |
def process_pdf(self, vectorstore, pdf_file, chunk_size, chunk_overlap, ai_model, type_model, api_key, project_id_watsonx):
|
63 |
return self.processor.process_pdf(vectorstore, pdf_file, chunk_size, chunk_overlap, ai_model, type_model, api_key, project_id_watsonx)
|
64 |
|
65 |
-
@spaces.GPU
|
66 |
def qa_interface(self, vectorstore, message, history, ai_model, type_model, api_key, project_id_watsonx):
|
67 |
return self.processor.get_qa_response(vectorstore, message, history, ai_model, type_model, api_key, project_id_watsonx)
|
68 |
|
69 |
-
@spaces.GPU
|
70 |
def summarize_interface(self, vectorstore, ai_model, type_model, api_key, project_id_watsonx):
|
71 |
return self.processor.get_summary(vectorstore, ai_model, type_model, api_key, project_id_watsonx)
|
72 |
|
73 |
-
@spaces.GPU
|
74 |
def specialist_opinion(self, vectorstore, ai_model, type_model, api_key, project_id_watsonx, specialist_prompt):
|
75 |
return self.processor.get_specialist_opinion(vectorstore, ai_model, type_model, api_key, project_id_watsonx, specialist_prompt)
|
76 |
|
@@ -78,10 +74,9 @@ class PDFProcessorUI:
|
|
78 |
file_paths = [file.name for file in files]
|
79 |
return file_paths[0]
|
80 |
|
81 |
-
@spaces.GPU
|
82 |
def create_ui(self):
|
83 |
with gr.Blocks() as demo:
|
84 |
-
vectorstore =
|
85 |
title = gr.Markdown(TRANSLATIONS[self.current_language]["title"])
|
86 |
|
87 |
with gr.Row():
|
|
|
58 |
else:
|
59 |
return gr.update(visible=False), gr.update(visible=False)
|
60 |
|
|
|
61 |
def process_pdf(self, vectorstore, pdf_file, chunk_size, chunk_overlap, ai_model, type_model, api_key, project_id_watsonx):
|
62 |
return self.processor.process_pdf(vectorstore, pdf_file, chunk_size, chunk_overlap, ai_model, type_model, api_key, project_id_watsonx)
|
63 |
|
|
|
64 |
def qa_interface(self, vectorstore, message, history, ai_model, type_model, api_key, project_id_watsonx):
|
65 |
return self.processor.get_qa_response(vectorstore, message, history, ai_model, type_model, api_key, project_id_watsonx)
|
66 |
|
|
|
67 |
def summarize_interface(self, vectorstore, ai_model, type_model, api_key, project_id_watsonx):
|
68 |
return self.processor.get_summary(vectorstore, ai_model, type_model, api_key, project_id_watsonx)
|
69 |
|
|
|
70 |
def specialist_opinion(self, vectorstore, ai_model, type_model, api_key, project_id_watsonx, specialist_prompt):
|
71 |
return self.processor.get_specialist_opinion(vectorstore, ai_model, type_model, api_key, project_id_watsonx, specialist_prompt)
|
72 |
|
|
|
74 |
file_paths = [file.name for file in files]
|
75 |
return file_paths[0]
|
76 |
|
|
|
77 |
def create_ui(self):
|
78 |
with gr.Blocks() as demo:
|
79 |
+
vectorstore = None
|
80 |
title = gr.Markdown(TRANSLATIONS[self.current_language]["title"])
|
81 |
|
82 |
with gr.Row():
|