tykiww commited on
Commit
00e285e
1 Parent(s): 86e8aa3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -8
app.py CHANGED
@@ -3,7 +3,12 @@
3
  ###########################
4
 
5
  ##################### Imports #####################
 
 
 
6
  import gradio as gr
 
 
7
  from utilities.setup import get_files
8
 
9
  from connections.pinecone import PineconeConnector
@@ -11,9 +16,6 @@ from connections.model import InferencePipeline
11
 
12
  from services.embed_service.embed import EmbeddingService
13
  from services.qa_service.qna import QAService
14
- #from server import QAService
15
-
16
- import spaces
17
 
18
  #################### Functions ####################
19
  @spaces.GPU
@@ -24,7 +26,6 @@ def process_transcripts(files, context, session_key):
24
  pinecone=pc_connector,
25
  session_key=session_key) as e:
26
  f = e.run(files)
27
- # some way to wait or a progress bar?
28
  return "Completed Loading Data"
29
 
30
  @spaces.GPU
@@ -41,8 +42,6 @@ def retrieve_answer(question, goals, session_key):
41
 
42
  return f, c
43
 
44
- import uuid
45
- import threading
46
 
47
  def drop_namespace(arg):
48
  print("Deleted namespace: " + arg)
@@ -55,8 +54,7 @@ def generate_key():
55
  # generate new namespace in pinecone
56
 
57
  return unique_key
58
-
59
- import gradio as gr
60
 
61
  def b_clicked(o):
62
  return gr.Button(interactive=True)
 
3
  ###########################
4
 
5
  ##################### Imports #####################
6
+ import uuid
7
+ import threading
8
+
9
  import gradio as gr
10
+ import spaces
11
+
12
  from utilities.setup import get_files
13
 
14
  from connections.pinecone import PineconeConnector
 
16
 
17
  from services.embed_service.embed import EmbeddingService
18
  from services.qa_service.qna import QAService
 
 
 
19
 
20
  #################### Functions ####################
21
  @spaces.GPU
 
26
  pinecone=pc_connector,
27
  session_key=session_key) as e:
28
  f = e.run(files)
 
29
  return "Completed Loading Data"
30
 
31
  @spaces.GPU
 
42
 
43
  return f, c
44
 
 
 
45
 
46
  def drop_namespace(arg):
47
  print("Deleted namespace: " + arg)
 
54
  # generate new namespace in pinecone
55
 
56
  return unique_key
57
+
 
58
 
59
  def b_clicked(o):
60
  return gr.Button(interactive=True)