Remove API URL field

#1
by tania-dm - opened
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -10,7 +10,7 @@ from segments import SegmentsClient
10
  from segments.exceptions import SegmentsError
11
 
12
 
13
- def run(api_key: str, dataset_identifier: str, api_url: str, csv_file: str) -> str:
14
  if not api_key or not dataset_identifier or not csv_file:
15
  return "Please fill in the API key, dataset identifier, and CSV file."
16
 
@@ -26,7 +26,7 @@ def run(api_key: str, dataset_identifier: str, api_url: str, csv_file: str) -> s
26
  return "No usernames found in CSV"
27
 
28
  try:
29
- client = SegmentsClient(api_key, api_url=api_url)
30
  except SegmentsError as error:
31
  return format_error_message(error)
32
 
@@ -42,7 +42,6 @@ demo = gr.Interface(
42
  inputs=[
43
  gr.Textbox(label="API key", type="password"),
44
  gr.Textbox(label="Dataset identifier", placeholder="jane/flowers"),
45
- gr.Textbox(label="API URL", value="https://api.segments.ai/api/v1/"),
46
  gr.File(label="CSV file", type="filepath"),
47
  ],
48
  outputs=gr.Textbox(label="Log", lines=15),
 
10
  from segments.exceptions import SegmentsError
11
 
12
 
13
+ def run(api_key: str, dataset_identifier: str, csv_file: str) -> str:
14
  if not api_key or not dataset_identifier or not csv_file:
15
  return "Please fill in the API key, dataset identifier, and CSV file."
16
 
 
26
  return "No usernames found in CSV"
27
 
28
  try:
29
+ client = SegmentsClient(api_key)
30
  except SegmentsError as error:
31
  return format_error_message(error)
32
 
 
42
  inputs=[
43
  gr.Textbox(label="API key", type="password"),
44
  gr.Textbox(label="Dataset identifier", placeholder="jane/flowers"),
 
45
  gr.File(label="CSV file", type="filepath"),
46
  ],
47
  outputs=gr.Textbox(label="Log", lines=15),