awacke1 commited on
Commit
545471a
1 Parent(s): 5401fa0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -14
app.py CHANGED
@@ -1,7 +1,4 @@
1
  import streamlit as st
2
- import firebase_admin
3
- from firebase_admin import credentials
4
- from firebase_admin import firestore
5
  import datetime
6
  from transformers import pipeline
7
  import gradio as gr
@@ -54,14 +51,6 @@ repo = Repository(
54
  local_dir="data", clone_from=DATASET_REPO_URL, use_auth_token=HF_TOKEN
55
  )
56
 
57
- @st.experimental_singleton
58
- def get_db_firestore():
59
- cred = credentials.Certificate('test.json')
60
- firebase_admin.initialize_app(cred, {'projectId': u'clinical-nlp-b9117',})
61
- db = firestore.client()
62
- return db
63
-
64
- db = get_db_firestore()
65
  asr = pipeline("automatic-speech-recognition", "facebook/wav2vec2-base-960h")
66
 
67
  MODEL_NAMES = [
@@ -114,9 +103,7 @@ def upsert(text):
114
  doc_ref = db.collection('Text2SpeechSentimentSave').document(date_time)
115
  doc_ref.set({u'firefield': 'Recognize Speech', u'first': 'https://huggingface.co/spaces/awacke1/TTS-STT-Blocks/', u'last': text, u'born': date_time,})
116
  saved = select('TTS-STT', date_time)
117
- # check it here: https://console.firebase.google.com/u/0/project/clinical-nlp-b9117/firestore/data/~2FStreamlitSpaces
118
-
119
- #rMem = AIMemory(text, saved)
120
 
121
  return saved
122
 
 
1
  import streamlit as st
 
 
 
2
  import datetime
3
  from transformers import pipeline
4
  import gradio as gr
 
51
  local_dir="data", clone_from=DATASET_REPO_URL, use_auth_token=HF_TOKEN
52
  )
53
 
 
 
 
 
 
 
 
 
54
  asr = pipeline("automatic-speech-recognition", "facebook/wav2vec2-base-960h")
55
 
56
  MODEL_NAMES = [
 
103
  doc_ref = db.collection('Text2SpeechSentimentSave').document(date_time)
104
  doc_ref.set({u'firefield': 'Recognize Speech', u'first': 'https://huggingface.co/spaces/awacke1/TTS-STT-Blocks/', u'last': text, u'born': date_time,})
105
  saved = select('TTS-STT', date_time)
106
+
 
 
107
 
108
  return saved
109