salomonsky commited on
Commit
c8e026c
1 Parent(s): 7eae688

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -8
app.py CHANGED
@@ -14,9 +14,8 @@ HF_TOKEN_UPSCALER = os.environ.get("HF_TOKEN_UPSCALER")
14
  client = AsyncInferenceClient()
15
  llm_client = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
16
 
17
- # Directorio de almacenamiento de imágenes
18
  DATA_PATH = Path("./data")
19
- DATA_PATH.mkdir(exist_ok=True) # Asegura que el directorio exista
20
 
21
  def enable_lora(lora_add, basemodel):
22
  return basemodel if not lora_add else lora_add
@@ -99,9 +98,7 @@ def get_storage():
99
  usage = sum([f['size'] for f in files])
100
  return [file["name"] for file in files], f"Uso total: {usage/(1024.0 ** 3):.3f}GB"
101
 
102
- css = """
103
- #col-container{ margin: 0 auto; max-width: 1024px;}
104
- """
105
 
106
  with gr.Blocks(css=css, theme="Nymbo/Nymbo_Theme") as demo:
107
  with gr.Column(elem_id="col-container"):
@@ -141,8 +138,9 @@ with gr.Blocks(css=css, theme="Nymbo/Nymbo_Theme") as demo:
141
  )
142
  with gr.Row():
143
  with gr.Column():
144
- file_list = gr.Gallery(label="Imágenes Guardadas") # Usar Gallery en lugar de Files
145
  storage_info = gr.Text(label="Uso de Almacenamiento")
146
- refresh_btn = gr.Button("Actualizar Galería")
147
- refresh_btn.click(fn=get_storage, inputs=None, outputs=[file_list, storage_info])
 
148
  demo.launch(allowed_paths=[str(DATA_PATH)])
 
14
  client = AsyncInferenceClient()
15
  llm_client = InferenceClient("mistralai/Mixtral-8x7B-Instruct-v0.1")
16
 
 
17
  DATA_PATH = Path("./data")
18
+ DATA_PATH.mkdir(exist_ok=True)
19
 
20
  def enable_lora(lora_add, basemodel):
21
  return basemodel if not lora_add else lora_add
 
98
  usage = sum([f['size'] for f in files])
99
  return [file["name"] for file in files], f"Uso total: {usage/(1024.0 ** 3):.3f}GB"
100
 
101
+ css = """#col-container{ margin: 0 auto; max-width: 1024px;}"""
 
 
102
 
103
  with gr.Blocks(css=css, theme="Nymbo/Nymbo_Theme") as demo:
104
  with gr.Column(elem_id="col-container"):
 
138
  )
139
  with gr.Row():
140
  with gr.Column():
141
+ file_list = gr.Gallery(label="Imágenes Guardadas")
142
  storage_info = gr.Text(label="Uso de Almacenamiento")
143
+ refresh_btn = gr.Button("Actualizar Galería")
144
+ refresh_btn.click(fn=get_storage, inputs=None, outputs=[file_list, storage_info])
145
+
146
  demo.launch(allowed_paths=[str(DATA_PATH)])