awacke1 commited on
Commit
a52d48d
Β·
1 Parent(s): c797cf0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -20
app.py CHANGED
@@ -52,23 +52,6 @@ DATASET_REPO_URL = "https://huggingface.co/datasets/awacke1/BookComposer"
52
  DATA_FILENAME = "BookComposer.csv"
53
  DATA_FILE=os.path.join("data", DATA_FILENAME)
54
  HF_TOKEN=os.environ.get("HF_TOKEN")
55
-
56
-
57
- def get_df(name: str):
58
- dataset = load_dataset(str, split="train")
59
- return dataset
60
-
61
- def store_message(name: str, message: str):
62
- if name and message:
63
- with open(DATA_FILE, "a") as csvfile:
64
- writer = csv.DictWriter(csvfile, fieldnames=[ "time", "message", "name", ])
65
- writer.writerow(
66
- {"time": str(datetime.now()), "message": message.strip(), "name": name.strip() }
67
- )
68
- commit_url = repo.push_to_hub()
69
- return ""
70
-
71
-
72
  repo = Repository(
73
  local_dir="data", clone_from=DATASET_REPO_URL, use_auth_token=HF_TOKEN
74
  )
@@ -145,9 +128,6 @@ with gr.Blocks() as demo:
145
  gallery = gr.Gallery(
146
  label="Generated images", show_label=False, elem_id="gallery"
147
  ).style(grid=[2], height="auto")
148
- gallery2 = gr.Gallery(
149
- label="Generated images 2", show_label=False, elem_id="gallery"
150
- ).style(grid=[2], height="auto")
151
 
152
  btn.click(gan, None, gallery)
153
 
 
52
  DATA_FILENAME = "BookComposer.csv"
53
  DATA_FILE=os.path.join("data", DATA_FILENAME)
54
  HF_TOKEN=os.environ.get("HF_TOKEN")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  repo = Repository(
56
  local_dir="data", clone_from=DATASET_REPO_URL, use_auth_token=HF_TOKEN
57
  )
 
128
  gallery = gr.Gallery(
129
  label="Generated images", show_label=False, elem_id="gallery"
130
  ).style(grid=[2], height="auto")
 
 
 
131
 
132
  btn.click(gan, None, gallery)
133