Ar4ikov commited on
Commit
6f1ac69
1 Parent(s): 050f024

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -7
app.py CHANGED
@@ -46,8 +46,7 @@ device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
46
  print(device)
47
 
48
 
49
- def recognize(audio, state={}):
50
- time.sleep(2)
51
  sr, audio_array = audio
52
  audio_array = audio_array.astype(np.float32)
53
  state = predict(audio_array, sr)
@@ -64,14 +63,12 @@ def test_some(audio):
64
  interface = gr.Interface(
65
  fn=recognize,
66
  inputs=[
67
- gr.Audio(source="microphone", label="Скажите что-нибудь..."),
68
- "state"
69
  ],
70
  outputs=[
71
- gr.Label(num_top_classes=7),
72
- "state"
73
  ],
74
- live=True,
75
  theme="huggingface")
76
 
77
  interface.launch(debug=True)
 
46
  print(device)
47
 
48
 
49
+ def recognize(audio):
 
50
  sr, audio_array = audio
51
  audio_array = audio_array.astype(np.float32)
52
  state = predict(audio_array, sr)
 
63
  interface = gr.Interface(
64
  fn=recognize,
65
  inputs=[
66
+ gr.Audio(source="microphone", label="Скажите что-нибудь...")
 
67
  ],
68
  outputs=[
69
+ gr.Label(num_top_classes=7)
 
70
  ],
71
+ live=False,
72
  theme="huggingface")
73
 
74
  interface.launch(debug=True)