andercorral commited on
Commit
a12adfc
·
1 Parent(s): 5e48419

Updated images

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -19,6 +19,9 @@ def langswitch_API_call(audio, language):
19
  files = {'file': (f'audio_chunk.wav', audio_bytes, 'audio/wav')}
20
  data = {'language': language}
21
  response = requests.post(os.getenv("api_url"), files=files, data=data)
 
 
 
22
  return response.json()
23
 
24
  def transcribe_base(audio, language):
@@ -55,7 +58,7 @@ css_content = """
55
  padding: 50px;
56
  text-align: center;
57
  font-size: 1rem;
58
- background: url('gradio_api/file=assets/code.webp') rgba(0,0,0,0.8);
59
  background-repeat: no-repeat;
60
  background-position: center center;
61
  background-size: cover;
@@ -179,10 +182,10 @@ with demo:
179
  <div id="orai-info">
180
  <div class="logos">
181
  <div class="sermas-logo">
182
- <img src="gradio_api/file=assets/sermas-logo.png" width=100/>
183
  <span>SERMAS</span>
184
  </div>
185
- <img src="gradio_api/file=assets/orai_bw.svg" width=175/>
186
  </div>
187
  <div id="orai-info-text">
188
  <p>The <span class="bold">LANGSWITCH</span> sub-project is part of the Open Call 1 of the <span class="bold">SERMAS</span> project. The goal of the <span class="bold">SERMAS</span> project is to provide socially-acceptable extended reality models and systems.</p>
@@ -192,4 +195,4 @@ with demo:
192
  </div>
193
  <p>""")
194
  demo.queue(max_size=1)
195
- demo.launch(share=False, max_threads=3, allowed_paths=[f"{os.getcwd()}/assets/"], auth=(os.getenv("username"), os.getenv("password")), auth_message="Please provide a username and a password.")
 
19
  files = {'file': (f'audio_chunk.wav', audio_bytes, 'audio/wav')}
20
  data = {'language': language}
21
  response = requests.post(os.getenv("api_url"), files=files, data=data)
22
+ if response.status_code != 200:
23
+ print(response)
24
+ raise Exception("API error")
25
  return response.json()
26
 
27
  def transcribe_base(audio, language):
 
58
  padding: 50px;
59
  text-align: center;
60
  font-size: 1rem;
61
+ background: url('https://elia.eus/static/elhuyar/img/landing_page/ig.webp') rgba(0,0,0,0.8);
62
  background-repeat: no-repeat;
63
  background-position: center center;
64
  background-size: cover;
 
182
  <div id="orai-info">
183
  <div class="logos">
184
  <div class="sermas-logo">
185
+ <img src="https://sermasproject.eu/wp-content/uploads/2023/04/sermas-logo.png" width=100/>
186
  <span>SERMAS</span>
187
  </div>
188
+ <img src="https://www.orai.eus/themes/custom/orai_for_drupal9/orai_bw.svg" width=175/>
189
  </div>
190
  <div id="orai-info-text">
191
  <p>The <span class="bold">LANGSWITCH</span> sub-project is part of the Open Call 1 of the <span class="bold">SERMAS</span> project. The goal of the <span class="bold">SERMAS</span> project is to provide socially-acceptable extended reality models and systems.</p>
 
195
  </div>
196
  <p>""")
197
  demo.queue(max_size=1)
198
+ demo.launch(share=False, max_threads=3, auth=(os.getenv("username"), os.getenv("password")), auth_message="Please provide a username and a password.")