davidberenstein1957 HF staff commited on
Commit
1bff30e
1 Parent(s): 84677f5

update env var in constants definition

Browse files
src/synthetic_dataset_generator/app.py CHANGED
@@ -23,7 +23,7 @@ image = """<br><img src="https://raw.githubusercontent.com/argilla-io/synthetic-
23
 
24
  demo = TabbedInterface(
25
  [textcat_app, chat_app, about_app],
26
- ["Text Classification", "Chat", "About"],
27
  css=css,
28
  title=image,
29
  theme=theme,
 
23
 
24
  demo = TabbedInterface(
25
  [textcat_app, chat_app, about_app],
26
+ ["Text Classification", "Chat Data", "About"],
27
  css=css,
28
  title=image,
29
  theme=theme,
src/synthetic_dataset_generator/constants.py CHANGED
@@ -15,15 +15,17 @@ if HF_TOKEN is None:
15
  )
16
 
17
  # Inference
18
- MAX_NUM_TOKENS = os.getenv("MAX_NUM_TOKENS", 2048)
19
- MAX_NUM_ROWS: str | int = os.getenv("MAX_NUM_ROWS", 1000)
20
- DEFAULT_BATCH_SIZE = os.getenv("DEFAULT_BATCH_SIZE", 5)
21
  MODEL = os.getenv("MODEL", "meta-llama/Meta-Llama-3.1-8B-Instruct")
22
- API_KEYS = (
23
- [os.getenv("HF_TOKEN")]
24
- + [os.getenv(f"HF_TOKEN_{i}") for i in range(1, 10)]
25
- + [os.getenv("API_KEY")]
26
- )
 
 
27
  API_KEYS = [token for token in API_KEYS if token]
28
  BASE_URL = os.getenv("BASE_URL", "https://api-inference.huggingface.co/v1/")
29
 
 
15
  )
16
 
17
  # Inference
18
+ MAX_NUM_TOKENS = int(os.getenv("MAX_NUM_TOKENS", 2048))
19
+ MAX_NUM_ROWS: str | int = int(os.getenv("MAX_NUM_ROWS", 1000))
20
+ DEFAULT_BATCH_SIZE = int(os.getenv("DEFAULT_BATCH_SIZE", 5))
21
  MODEL = os.getenv("MODEL", "meta-llama/Meta-Llama-3.1-8B-Instruct")
22
+ _API_KEY = os.getenv("API_KEY")
23
+ if _API_KEY:
24
+ API_KEYS = [_API_KEY]
25
+ else:
26
+ API_KEYS = [os.getenv("HF_TOKEN")] + [
27
+ os.getenv(f"HF_TOKEN_{i}") for i in range(1, 10)
28
+ ]
29
  API_KEYS = [token for token in API_KEYS if token]
30
  BASE_URL = os.getenv("BASE_URL", "https://api-inference.huggingface.co/v1/")
31