xJuuzouYTx commited on
Commit
1b5ebf2
1 Parent(s): 8a2d42b

[UPDATE] table seach results

Browse files
Files changed (1) hide show
  1. app.py +12 -4
app.py CHANGED
@@ -102,7 +102,7 @@ def post_model(name, model_url, version, creator):
102
  return result
103
 
104
  def search_model(name):
105
- web_service_url = "https://script.google.com/macros/s/AKfycbzfIOiwmPj-q8-hEyvjRQfgLtO7ESolmtsQmnNheCujwnitDApBSjgTecdfXb8f2twT/exec"
106
  response = requests.post(web_service_url, json={
107
  'type': 'search_by_filename',
108
  'name': name
@@ -111,13 +111,21 @@ def search_model(name):
111
  response.raise_for_status() # Lanza una excepción en caso de error
112
  json_response = response.json()
113
  cont = 0
 
 
 
 
114
  if json_response.get('ok', None):
115
  for model in json_response['ocurrences']:
116
  if cont < 20:
117
- model_name = model.get('name', 'N/A')
118
  model_url = model.get('url', 'N/A')
119
- result.append(f"**Nombre del modelo: {model_name}**</br>{model_url}</br>")
120
- yield "</br>".join(result)
 
 
 
 
121
  cont += 1
122
 
123
  def update_tts_methods_voice(select_value):
 
102
  return result
103
 
104
  def search_model(name):
105
+ web_service_url = "https://script.google.com/macros/s/AKfycbyRaNxtcuN8CxUrcA_nHW6Sq9G2QJor8Z2-BJUGnQ2F_CB8klF4kQL--U2r2MhLFZ5J/exec"
106
  response = requests.post(web_service_url, json={
107
  'type': 'search_by_filename',
108
  'name': name
 
111
  response.raise_for_status() # Lanza una excepción en caso de error
112
  json_response = response.json()
113
  cont = 0
114
+ result.append("""| Nombre del modelo | Url | Epoch | Sample Rate |
115
+ | ---------------- | -------------- |:------:|:-----------:|
116
+ """)
117
+ yield "<br />".join(result)
118
  if json_response.get('ok', None):
119
  for model in json_response['ocurrences']:
120
  if cont < 20:
121
+ model_name = str(model.get('name', 'N/A')).strip()
122
  model_url = model.get('url', 'N/A')
123
+ epoch = model.get('epoch', 'N/A')
124
+ sr = model.get('sr', 'N/A')
125
+ line = f"""|{model_name}|<a>{model_url}</a>|{epoch}|{sr}|
126
+ """
127
+ result.append(line)
128
+ yield "".join(result)
129
  cont += 1
130
 
131
  def update_tts_methods_voice(select_value):