EnigmaOfTheWorld commited on
Commit
f0ccffb
·
1 Parent(s): 224ad7b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -43,7 +43,7 @@ whisper_from_pipeline = pipeline("automatic-speech-recognition",model="openai/wh
43
  EMBEDIDNGS = None
44
  DATAFRAME_FILE = None
45
  RANDOM_USER = ''.join(chr(random.randint(65,90)) for i in range(8))+f'{random.randint(1,10000000000)}'
46
-
47
 
48
  ############# FUNCTION DEPENDING ON IPYTHON FUNCTIONS FROM OPENAI RESPONSE
49
  def gen_draw(user_query:str)->tuple:
@@ -288,8 +288,8 @@ def build_embeddings(file_name,file_ext):
288
  EMBEDIDNGS = OpenAIEmbeddings(openai_api_key=os.environ['OPENAI_API_KEY'])
289
  docsearch = FAISS.from_texts(texts, EMBEDIDNGS)
290
  if not os.path.exists(f'/tmp/{RANDOM_USER}embeddings'):
291
- os.mkdir('/tmp/{RANDOM_USER}embeddings')
292
- docsearch.save_local('/tmp/{RANDOM_USER}embeddings')
293
  print(f'Embeddings created to /tmp/{RANDOM_USER}embeddings')
294
 
295
 
 
43
  EMBEDIDNGS = None
44
  DATAFRAME_FILE = None
45
  RANDOM_USER = ''.join(chr(random.randint(65,90)) for i in range(8))+f'{random.randint(1,10000000000)}'
46
+ print(f'{RANDOM_USER} chat started')
47
 
48
  ############# FUNCTION DEPENDING ON IPYTHON FUNCTIONS FROM OPENAI RESPONSE
49
  def gen_draw(user_query:str)->tuple:
 
288
  EMBEDIDNGS = OpenAIEmbeddings(openai_api_key=os.environ['OPENAI_API_KEY'])
289
  docsearch = FAISS.from_texts(texts, EMBEDIDNGS)
290
  if not os.path.exists(f'/tmp/{RANDOM_USER}embeddings'):
291
+ os.mkdir(f'/tmp/{RANDOM_USER}embeddings')
292
+ docsearch.save_local('f/tmp/{RANDOM_USER}embeddings')
293
  print(f'Embeddings created to /tmp/{RANDOM_USER}embeddings')
294
 
295