acumplid commited on
Commit
3f8ccb5
1 Parent(s): 1339986

Included dropdown with locations

Browse files
Files changed (1) hide show
  1. app.py +7 -0
app.py CHANGED
@@ -12,6 +12,9 @@ MAX_INPUT_CHARACTERS= int(os.environ.get("MAX_INPUT_CHARACTERS", default=200))
12
  SHOW_MODEL_PARAMETERS_IN_UI = os.environ.get("SHOW_MODEL_PARAMETERS_IN_UI", default=False)
13
  MAX_NEW_TOKENS = int(os.environ.get("MAX_NEW_TOKENS", default=200))
14
 
 
 
 
15
  def csv_to_dict(file_path):
16
  result = []
17
  with open(file_path, 'r') as file:
@@ -103,6 +106,10 @@ with gr.Blocks(**AinaGradioTheme().get_kwargs()) as demo:
103
  label="Input",
104
  placeholder="e.g. Prompt example."
105
  )
 
 
 
 
106
  with gr.Row(variant="panel", equal_height=True):
107
  gr.HTML("""<span id="countertext" style="display: flex; justify-content: start; color:#ef4444; font-weight: bold;"></span>""")
108
  gr.HTML(f"""<span id="counter" style="display: flex; justify-content: end;"> <span id="inputlenght">0</span>&nbsp;/&nbsp;{MAX_INPUT_CHARACTERS}</span>""")
 
12
  SHOW_MODEL_PARAMETERS_IN_UI = os.environ.get("SHOW_MODEL_PARAMETERS_IN_UI", default=False)
13
  MAX_NEW_TOKENS = int(os.environ.get("MAX_NEW_TOKENS", default=200))
14
 
15
+ with open('./locations.txt', 'r', encoding='utf-8') as file:
16
+ locations = file.read().splitlines()
17
+
18
  def csv_to_dict(file_path):
19
  result = []
20
  with open(file_path, 'r') as file:
 
106
  label="Input",
107
  placeholder="e.g. Prompt example."
108
  )
109
+ gr.Dropdown(
110
+ label="Available locations",
111
+ choices=locations
112
+ )
113
  with gr.Row(variant="panel", equal_height=True):
114
  gr.HTML("""<span id="countertext" style="display: flex; justify-content: start; color:#ef4444; font-weight: bold;"></span>""")
115
  gr.HTML(f"""<span id="counter" style="display: flex; justify-content: end;"> <span id="inputlenght">0</span>&nbsp;/&nbsp;{MAX_INPUT_CHARACTERS}</span>""")