truongghieu commited on
Commit
923c281
·
1 Parent(s): fc96d43

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -2
app.py CHANGED
@@ -9,7 +9,6 @@ question_text = "This is a question"
9
  answer_text = "This is an answer"
10
 
11
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
12
- # default config
13
  bnb_config = BitsAndBytesConfig(
14
  load_in_4bit=True, bnb_4bit_quant_type="nf4", bnb_4bit_compute_dtype="float16", bnb_4bit_use_double_quant=True
15
  )
@@ -55,7 +54,16 @@ def recognize_speech(audio_data):
55
  return f"Could not request results from Google Speech Recognition service; {e}"
56
 
57
 
58
- with gr.Blocks as demo:
 
 
 
 
 
 
 
 
 
59
  with gr.Row():
60
  gr.Label("Speech Recognition")
61
  inp = gr.Audio(type="numpy")
 
9
  answer_text = "This is an answer"
10
 
11
  device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
 
12
  bnb_config = BitsAndBytesConfig(
13
  load_in_4bit=True, bnb_4bit_quant_type="nf4", bnb_4bit_compute_dtype="float16", bnb_4bit_use_double_quant=True
14
  )
 
54
  return f"Could not request results from Google Speech Recognition service; {e}"
55
 
56
 
57
+ # audio_input = gr.Audio(type="numpy")
58
+
59
+ # iface = gr.Interface(fn=recognize_speech, inputs=audio_input , outputs="text", title="Speech to Text")
60
+ # # create a place to generate answer
61
+ # answer_text = gr.Textbox(label="Answer")
62
+ # iface_answer = gr.Interface(fn=generate_text, inputs=question_text , outputs="text", title="Answer")
63
+
64
+ # iface.launch()
65
+
66
+ with gr.Blocks() as demo:
67
  with gr.Row():
68
  gr.Label("Speech Recognition")
69
  inp = gr.Audio(type="numpy")