소스 검색

Fixing mic example, checking if there is a Spanish system deployed

jjorgeDSIC 4 년 전
부모
커밋
20fdcc398c
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  1. 5 1
      python_examples/client.mic.py

+ 5 - 1
python_examples/client.mic.py

@@ -42,13 +42,17 @@ def myStreamIterator():
     stream.stop_stream()
     stream.close()
     p.terminate()
-    
+
+es_system = {}
 
 #Select Spanish system for testing
 for system in systems:
     if system['info']['langs'][0]['code'] == "es":
         es_system = system    
 
+if es_system == {}:
+    raise Exception("Spanish system not found") 
+        
 #Selects the system with the system id for the Spanish system, updated in Feb20
 for resp in cli.transcribe(es_system, myStreamIterator):
     # Hyp_var contains part of the hypothesis that is not consolidated yet (hypothesis could change)