infinitymatter commited on
Commit
b989f48
·
verified ·
1 Parent(s): 925f18e

Update synthetic_generator.py

Browse files
Files changed (1) hide show
  1. synthetic_generator.py +2 -1
synthetic_generator.py CHANGED
@@ -4,6 +4,7 @@ from sklearn.preprocessing import LabelEncoder
4
  import os
5
  import json
6
  import requests
 
7
 
8
  def train_and_generate_synthetic(real_data, schema, output_path):
9
  """Trains a CTGAN model and generates synthetic data."""
@@ -35,7 +36,7 @@ def train_and_generate_synthetic(real_data, schema, output_path):
35
  def generate_schema(prompt):
36
  """Fetches schema from an external API and validates JSON."""
37
  API_URL = "https://infinitymatter-synthetic-data-generator-srijan.hf.space/run/predict"
38
- headers = {"Authorization": f"Bearer hf_token"} # Add if needed
39
 
40
  try:
41
  response = requests.post(API_URL, json={"prompt": prompt}, headers=headers)
 
4
  import os
5
  import json
6
  import requests
7
+ import streamlit as st
8
 
9
  def train_and_generate_synthetic(real_data, schema, output_path):
10
  """Trains a CTGAN model and generates synthetic data."""
 
36
  def generate_schema(prompt):
37
  """Fetches schema from an external API and validates JSON."""
38
  API_URL = "https://infinitymatter-synthetic-data-generator-srijan.hf.space/run/predict"
39
+ headers = {"Authorization": f"Bearer {st.secrets['hf_token']}"}
40
 
41
  try:
42
  response = requests.post(API_URL, json={"prompt": prompt}, headers=headers)